summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-28 14:29:31 +0300
commita905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch)
tree87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/IRCG
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/src/main.cpp49
-rw-r--r--protocols/IRCG/src/stdafx.h1
2 files changed, 27 insertions, 23 deletions
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index c821c183c2..81ff6f6581 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -73,20 +73,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
-static CIrcProto* ircProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
-{
- CIrcProto *ppro = new CIrcProto(pszProtoName, tszUserName);
- g_Instances.insert(ppro);
- return ppro;
-}
-
-static int ircProtoUninit(CIrcProto *ppro)
-{
- g_Instances.remove((CIrcProto*)ppro);
- delete ppro;
- return 0;
-}
-
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfo);
@@ -96,15 +82,6 @@ extern "C" int __declspec(dllexport) Load()
InitIcons();
InitServers();
InitContactMenus();
-
- // register protocol
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "IRC";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = (pfnInitProto)ircProtoInit;
- pd.fnUninit = (pfnUninitProto)ircProtoUninit;
- Proto_RegisterModule(&pd);
return 0;
}
@@ -116,3 +93,29 @@ extern "C" int __declspec(dllexport) Unload(void)
UninitTimers();
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* ircProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
+{
+ CIrcProto *ppro = new CIrcProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
+}
+
+static int ircProtoUninit(PROTO_INTERFACE *ppro)
+{
+ g_Instances.remove((CIrcProto*)ppro);
+ delete (CIrcProto*)ppro;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("IRC")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, ircProtoInit, ircProtoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index 16f753c395..eef1cb6a10 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -66,6 +66,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_string.h"
#include "win2k.h"
#include "m_gui.h"
+#include <m_plugin.h>
#include "resource.h"