summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
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/IcqOscarJ
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/init.cpp49
-rw-r--r--protocols/IcqOscarJ/src/stdafx.h1
2 files changed, 27 insertions, 23 deletions
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 5eb94cfed0..fb53d2312e 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -64,20 +64,6 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
/////////////////////////////////////////////////////////////////////////////////////////
-static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
-{
- CIcqProto *ppro = new CIcqProto(pszProtoName, tszUserName);
- g_Instances.insert(ppro);
- return ppro;
-}
-
-static int icqProtoUninit(PROTO_INTERFACE* ppro)
-{
- g_Instances.remove((CIcqProto*)ppro);
- delete (CIcqProto*)ppro;
- return 0;
-}
-
int ModuleLoad(WPARAM, LPARAM)
{
bPopupService = ServiceExists(MS_POPUP_ADDPOPUPT);
@@ -103,15 +89,6 @@ extern "C" int __declspec(dllexport) Load(void)
srand(time(nullptr));
_tzset();
- // Register the module
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = ICQ_PROTOCOL_NAME;
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = icqProtoInit;
- pd.fnUninit = icqProtoUninit;
- Proto_RegisterModule(&pd);
-
// Initialize charset conversion routines
InitI18N();
@@ -183,3 +160,29 @@ void CIcqProto::UpdateGlobalSettings()
m_bXStatusEnabled = getByte("XStatusEnabled", DEFAULT_XSTATUS_ENABLED);
m_bMoodsEnabled = getByte("MoodsEnabled", DEFAULT_MOODS_ENABLED);
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
+{
+ CIcqProto *ppro = new CIcqProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
+}
+
+static int icqProtoUninit(PROTO_INTERFACE* ppro)
+{
+ g_Instances.remove((CIcqProto*)ppro);
+ delete (CIcqProto*)ppro;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase(ICQ_PROTOCOL_NAME)
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, icqProtoInit, icqProtoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/IcqOscarJ/src/stdafx.h b/protocols/IcqOscarJ/src/stdafx.h
index 27c90396b8..61877a2a58 100644
--- a/protocols/IcqOscarJ/src/stdafx.h
+++ b/protocols/IcqOscarJ/src/stdafx.h
@@ -80,6 +80,7 @@
#include <m_timezones.h>
#include <win2k.h>
#include <m_gui.h>
+#include <m_plugin.h>
// Project resources
#include "resource.h"