From a905c9c3f92fd54f37a5466649ac378db69e7cb0 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Wed, 28 Mar 2018 14:29:31 +0300
Subject: all protocols rewritten to CMPluginBase

---
 protocols/Tox/src/main.cpp | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

(limited to 'protocols/Tox/src/main.cpp')

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;
-- 
cgit v1.2.3