summaryrefslogtreecommitdiff
path: root/protocols/Tox
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/Tox
parentd75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff)
all protocols rewritten to CMPluginBase
Diffstat (limited to 'protocols/Tox')
-rw-r--r--protocols/Tox/src/main.cpp22
-rw-r--r--protocols/Tox/src/stdafx.h1
2 files changed, 14 insertions, 9 deletions
diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp
index 6bff578137..8cf2c4b80d 100644
--- a/protocols/Tox/src/main.cpp
+++ b/protocols/Tox/src/main.cpp
@@ -54,14 +54,6 @@ extern "C" int __declspec(dllexport) Load(void)
pci = Chat_GetInterface();
pcli = Clist_GetInterface();
- PROTOCOLDESCRIPTOR pd = { 0 };
- pd.cbSize = sizeof(pd);
- pd.szName = "TOX";
- pd.type = PROTOTYPE_PROTOCOL;
- pd.fnInit = (pfnInitProto)CToxProto::InitAccount;
- pd.fnUninit = (pfnUninitProto)CToxProto::UninitAccount;
- Proto_RegisterModule(&pd);
-
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
return 0;
@@ -70,4 +62,16 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
-} \ No newline at end of file
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+struct CMPlugin : public CMPluginBase
+{
+ CMPlugin() :
+ CMPluginBase("TOX")
+ {
+ RegisterProtocol(PROTOTYPE_PROTOCOL, (pfnInitProto)CToxProto::InitAccount, (pfnUninitProto)CToxProto::UninitAccount);
+ }
+}
+ g_plugin;
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h
index cb16bf8078..d6270b9373 100644
--- a/protocols/Tox/src/stdafx.h
+++ b/protocols/Tox/src/stdafx.h
@@ -36,6 +36,7 @@
#include <m_assocmgr.h>
#include <m_json.h>
#include <m_http.h>
+#include <m_plugin.h>
#include <tox.h>
#include <toxencryptsave.h>