From a905c9c3f92fd54f37a5466649ac378db69e7cb0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Mar 2018 14:29:31 +0300 Subject: all protocols rewritten to CMPluginBase --- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 20 +++++++++++++------- plugins/ConnectionNotify/src/stdafx.h | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'plugins/ConnectionNotify/src') diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index cb1e82dbec..a703a9f5a2 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -859,13 +859,7 @@ extern "C" int __declspec(dllexport) Load(void) LoadSettings(); connExceptions = LoadSettingsConnections(); - PROTOCOLDESCRIPTOR pd = { 0 }; - pd.cbSize = sizeof(pd); - pd.szName = PLUGINNAME; - pd.type = PROTOTYPE_PROTOCOL; - Proto_RegisterModule(&pd); - - //set all contacts to offline + // set all contacts to offline for (auto &hContact : Contacts(PLUGINNAME)) db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE); @@ -903,3 +897,15 @@ extern "C" int __declspec(dllexport) Unload(void) #endif return 0; } + +///////////////////////////////////////////////////////////////////////////////////////// + +struct CMPlugin : public CMPluginBase +{ + CMPlugin() : + CMPluginBase(PLUGINNAME) + { + RegisterProtocol(PROTOTYPE_PROTOCOL); + } +} + g_plugin; diff --git a/plugins/ConnectionNotify/src/stdafx.h b/plugins/ConnectionNotify/src/stdafx.h index 2837c72125..201a5a233f 100644 --- a/plugins/ConnectionNotify/src/stdafx.h +++ b/plugins/ConnectionNotify/src/stdafx.h @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef _DEBUG #include "debug.h" -- cgit v1.2.3