summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MSN/src/msn.cpp')
-rw-r--r--protocols/MSN/src/msn.cpp46
1 files changed, 25 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;