summaryrefslogtreecommitdiff
path: root/protocols/Sametime/src/sametime.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/Sametime/src/sametime.cpp
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/Sametime/src/sametime.cpp')
-rw-r--r--protocols/Sametime/src/sametime.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index 6f0d783b14..faebb0d6c3 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -246,7 +246,22 @@ void CSametimeProto::BroadcastNewStatus(int iNewStatus)
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)previous_status, m_iStatus);
}
-static CSametimeProto* sametime_proto_init(const char* pszProtoName, const wchar_t* tszUserName)
+extern "C" int __declspec(dllexport) Load(void)
+{
+ mir_getLP(&pluginInfo);
+ pcli = Clist_GetInterface();
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload()
+{
+ g_Instances.destroy();
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* sametime_proto_init(const char* pszProtoName, const wchar_t* tszUserName)
{
CSametimeProto* proto = new CSametimeProto(pszProtoName, tszUserName);
g_Instances.insert(proto);
@@ -261,24 +276,12 @@ static int sametime_proto_uninit(PROTO_INTERFACE* ppro)
return 0;
}
-extern "C" int __declspec(dllexport) Load(void)
+struct CMPlugin : public CMPluginBase
{
- mir_getLP(&pluginInfo);
- pcli = Clist_GetInterface();
-
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.type = PROTOTYPE_PROTOCOL;
- pd.szName = "Sametime";
- pd.fnInit = (pfnInitProto)sametime_proto_init;
- pd.fnUninit = (pfnUninitProto)sametime_proto_uninit;
- Proto_RegisterModule(&pd);
- return 0;
-}
-
-extern "C" int __declspec(dllexport) Unload()
-{
- g_Instances.destroy();
- return 0;
+ CMPlugin() :
+ CMPluginBase("Sametime")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, sametime_proto_init, sametime_proto_uninit);
+ }
}
-
+ g_plugin;