summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src
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/Omegle/src
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/Omegle/src')
-rw-r--r--protocols/Omegle/src/main.cpp46
-rw-r--r--protocols/Omegle/src/stdafx.h1
2 files changed, 26 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;
diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h
index f216b4932c..e492ad25d2 100644
--- a/protocols/Omegle/src/stdafx.h
+++ b/protocols/Omegle/src/stdafx.h
@@ -58,6 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_message.h>
#include <m_http.h>
#include <m_json.h>
+#include <m_plugin.h>
#include "version.h"