summaryrefslogtreecommitdiff
path: root/protocols/MSN
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/MSN
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn.cpp46
-rw-r--r--protocols/MSN/src/stdafx.h1
2 files changed, 26 insertions, 21 deletions
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp
index 697c1f6569..71dc64eb4f 100644
--- a/protocols/MSN/src/msn.cpp
+++ b/protocols/MSN/src/msn.cpp
@@ -82,19 +82,6 @@ static int OnModulesLoaded(WPARAM, LPARAM)
return 0;
}
-static CMsnProto* msnProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
-{
- CMsnProto *ppro = new CMsnProto(pszProtoName, tszUserName);
- g_Instances.insert(ppro);
- return ppro;
-}
-
-static int msnProtoUninit(CMsnProto* ppro)
-{
- g_Instances.remove(ppro);
- return 0;
-}
-
// Performs a primary set of actions upon plugin loading
extern "C" int __declspec(dllexport) Load(void)
{
@@ -103,14 +90,6 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "MSN";
- pd.fnInit = (pfnInitProto)msnProtoInit;
- pd.fnUninit = (pfnUninitProto)msnProtoUninit;
- pd.type = PROTOTYPE_PROTOCOL;
- Proto_RegisterModule(&pd);
-
MsnInitIcons();
MSN_InitContactMenu();
return 0;
@@ -135,3 +114,28 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
// MirandaInterfaces - returns the protocol interface to the core
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* msnProtoInit(const char *pszProtoName, const wchar_t *tszUserName)
+{
+ CMsnProto *ppro = new CMsnProto(pszProtoName, tszUserName);
+ g_Instances.insert(ppro);
+ return ppro;
+}
+
+static int msnProtoUninit(PROTO_INTERFACE *ppro)
+{
+ g_Instances.remove((CMsnProto*)ppro);
+ return 0;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("MSN")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, msnProtoInit, msnProtoUninit);
+ }
+}
+ g_plugin;
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
index df61064891..1eb9ce25a3 100644
--- a/protocols/MSN/src/stdafx.h
+++ b/protocols/MSN/src/stdafx.h
@@ -63,6 +63,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_nudge.h>
#include <m_string.h>
#include <m_json.h>
+#include <m_plugin.h>
#include "m_proto_listeningto.h"
#include "m_folders.h"