diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
commit | a905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch) | |
tree | 87a60dadfbf9fd8d916ea9100c26b6e314293242 /protocols/Sametime | |
parent | d75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff) |
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/Sametime')
-rw-r--r-- | protocols/Sametime/src/StdAfx.h | 1 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 43 |
2 files changed, 24 insertions, 20 deletions
diff --git a/protocols/Sametime/src/StdAfx.h b/protocols/Sametime/src/StdAfx.h index 5fa7d2b4d3..9f8fe88525 100644 --- a/protocols/Sametime/src/StdAfx.h +++ b/protocols/Sametime/src/StdAfx.h @@ -75,3 +75,4 @@ extern "C" { #include <m_genmenu.h>
#include <m_icolib.h>
#include <m_string.h>
+#include <m_plugin.h>
\ No newline at end of file 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;
|