summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
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"