summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber.cpp
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/JabberG/src/jabber.cpp
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/JabberG/src/jabber.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index c6046e2b2e..06523ae7eb 100755
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -163,21 +163,6 @@ static int OnModulesLoaded(WPARAM, LPARAM)
///////////////////////////////////////////////////////////////////////////////
// OnLoad - initialize the plugin instance
-static CJabberProto* jabberProtoInit(const char* pszProtoName, const wchar_t *tszUserName)
-{
- CJabberProto *ppro = new CJabberProto(pszProtoName, tszUserName);
- g_Instances.insert(ppro);
- return ppro;
-}
-
-static int jabberProtoUninit(CJabberProto *ppro)
-{
- g_Instances.remove(ppro);
- delete ppro;
- return 0;
-}
-
-
extern "C" int __declspec(dllexport) Load()
{
// set the memory, lists & utf8 managers
@@ -196,15 +181,6 @@ extern "C" int __declspec(dllexport) Load()
hExtListInit = CreateHookableEvent(ME_JABBER_EXTLISTINIT);
hDiscoInfoResult = CreateHookableEvent(ME_JABBER_SRVDISCOINFO);
- // Register protocol module
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "JABBER";
- pd.fnInit = (pfnInitProto)jabberProtoInit;
- pd.fnUninit = (pfnUninitProto)jabberProtoUninit;
- pd.type = PROTOTYPE_PROTOCOL;
- Proto_RegisterModule(&pd);
-
g_IconsInit();
g_XstatusIconsInit();
@@ -251,3 +227,29 @@ extern "C" int __declspec(dllexport) Unload(void)
g_MenuUninit();
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* jabberProtoInit(const char* pszProtoName, const wchar_t *tszUserName)
+{
+ CJabberProto *ppro = new CJabberProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
+}
+
+static int jabberProtoUninit(PROTO_INTERFACE *ppro)
+{
+ g_Instances.remove((CJabberProto*)ppro);
+ delete (CJabberProto*)ppro;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase(GLOBAL_SETTING_MODULE)
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, jabberProtoInit, jabberProtoUninit);
+ }
+}
+ g_plugin;