summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Omegle/src/main.cpp')
-rw-r--r--protocols/Omegle/src/main.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp
index a27baa0e5b..4d5cc3be73 100644
--- a/protocols/Omegle/src/main.cpp
+++ b/protocols/Omegle/src/main.cpp
@@ -73,19 +73,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
/////////////////////////////////////////////////////////////////////////////////////////
// Load
-static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
-{
- OmegleProto *proto = new OmegleProto(proto_name, username);
- g_Instances.insert(proto);
- return proto;
-}
-
-static int protoUninit(PROTO_INTERFACE* proto)
-{
- g_Instances.remove((OmegleProto*)proto);
- return EXIT_SUCCESS;
-}
-
static HANDLE g_hEvents[1];
extern "C" int __declspec(dllexport) Load(void)
@@ -93,14 +80,6 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
pcli = Clist_GetInterface();
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "Omegle";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = protoInit;
- pd.fnUninit = protoUninit;
- Proto_RegisterModule(&pd);
-
InitIcons();
//InitContactMenus();
@@ -138,3 +117,28 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static PROTO_INTERFACE* protoInit(const char *proto_name, const wchar_t *username)
+{
+ OmegleProto *proto = new OmegleProto(proto_name, username);
+ g_Instances.insert(proto);
+ return proto;
+}
+
+static int protoUninit(PROTO_INTERFACE* proto)
+{
+ g_Instances.remove((OmegleProto*)proto);
+ return EXIT_SUCCESS;
+}
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("Omegle")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, protoInit, protoUninit);
+ }
+}
+ g_plugin;