summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/gg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu/src/gg.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp57
1 files changed, 27 insertions, 30 deletions
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index c46aee7c65..31ba420df2 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -310,27 +310,6 @@ void GaduProto::menus_init()
}
//////////////////////////////////////////////////////////
-// Module instance initialization
-//
-static GaduProto *gg_proto_init(const char* pszProtoName, const wchar_t* tszUserName)
-{
- GaduProto *gg = new GaduProto(pszProtoName, tszUserName);
- g_Instances.insert(gg);
- return gg;
-}
-
-//////////////////////////////////////////////////////////
-// Module instance uninitialization
-//
-static int gg_proto_uninit(PROTO_INTERFACE *proto)
-{
- GaduProto *gg = (GaduProto *)proto;
- g_Instances.remove(gg);
- delete gg;
- return 0;
-}
-
-//////////////////////////////////////////////////////////
// When plugin is loaded
//
extern "C" int __declspec(dllexport) Load(void)
@@ -340,15 +319,6 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, gg_modulesloaded);
- // Prepare protocol name
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = GGDEF_PROTO;
- pd.fnInit = (pfnInitProto)gg_proto_init;
- pd.fnUninit = (pfnUninitProto)gg_proto_uninit;
- pd.type = PROTOTYPE_PROTOCOL;
- Proto_RegisterModule(&pd);
-
gg_links_instancemenu_init();
return 0;
}
@@ -467,3 +437,30 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD, LPVOID)
#endif
return TRUE;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* gg_proto_init(const char *pszProtoName, const wchar_t *tszUserName)
+{
+ GaduProto *gg = new GaduProto(pszProtoName, tszUserName);
+ g_Instances.insert(gg);
+ return gg;
+}
+
+static int gg_proto_uninit(PROTO_INTERFACE *proto)
+{
+ GaduProto *gg = (GaduProto*)proto;
+ g_Instances.remove(gg);
+ delete gg;
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase(GGDEF_PROTO)
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, gg_proto_init, gg_proto_uninit);
+ }
+}
+ g_plugin;