From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- protocols/Discord/src/main.cpp | 12 +++++-- protocols/Discord/src/proto.h | 6 +--- protocols/Dummy/src/dummy.h | 10 +----- protocols/Dummy/src/main.cpp | 33 +++++++++++------- protocols/EmLanProto/src/amdproto.cpp | 13 +++++-- protocols/EmLanProto/src/stdafx.h | 7 +--- protocols/FacebookRM/src/main.cpp | 19 ++++++---- protocols/FacebookRM/src/proto.h | 6 +--- protocols/Gadu-Gadu/src/gg.cpp | 61 ++++++++++++++++++--------------- protocols/Gadu-Gadu/src/gg.h | 2 +- protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/Gadu-Gadu/src/gg_proto.h | 7 +--- protocols/ICQCorp/src/corp.cpp | 21 ++++++++++-- protocols/ICQCorp/src/stdafx.h | 15 +------- protocols/IRCG/src/ircproto.h | 6 +--- protocols/IRCG/src/main.cpp | 34 ++++++++++-------- protocols/IcqOscarJ/src/icq_proto.cpp | 2 -- protocols/IcqOscarJ/src/icq_proto.h | 6 +--- protocols/IcqOscarJ/src/init.cpp | 14 ++++++-- protocols/JabberG/src/jabber.cpp | 19 +++++----- protocols/JabberG/src/jabber_proto.h | 6 +--- protocols/MRA/src/Mra.cpp | 13 ++++--- protocols/MRA/src/MraProto.h | 6 +--- protocols/MSN/src/msn.cpp | 20 +++++++---- protocols/MSN/src/msn_proto.h | 7 +--- protocols/MinecraftDynmap/src/main.cpp | 32 +++++++---------- protocols/MinecraftDynmap/src/proto.h | 6 +--- protocols/MinecraftDynmap/src/stdafx.h | 1 - protocols/Omegle/src/main.cpp | 19 ++++++---- protocols/Omegle/src/proto.h | 6 +--- protocols/Sametime/src/sametime.cpp | 12 +++++-- protocols/Sametime/src/sametime.h | 2 -- protocols/Sametime/src/sametime_proto.h | 6 +--- protocols/SkypeWeb/src/main.cpp | 24 ++++++++----- protocols/SkypeWeb/src/skype_proto.h | 6 +--- protocols/Steam/src/main.cpp | 19 ++++++---- protocols/Steam/src/steam_proto.h | 6 +--- protocols/Tox/src/main.cpp | 22 +++++++----- protocols/Tox/src/tox_proto.h | 6 +--- protocols/Twitter/src/main.cpp | 20 ++++++----- protocols/Twitter/src/proto.h | 6 +--- protocols/VKontakte/src/main.cpp | 21 +++++++----- protocols/VKontakte/src/vk_proto.h | 6 +--- 43 files changed, 287 insertions(+), 280 deletions(-) (limited to 'protocols') diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp index 1076f3f503..3fadfdfa03 100644 --- a/protocols/Discord/src/main.cpp +++ b/protocols/Discord/src/main.cpp @@ -21,7 +21,7 @@ CHAT_MANAGER *pci; int &hLangpack(g_plugin.m_hLang); HWND g_hwndHeartbeat; -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -34,9 +34,15 @@ PLUGININFOEX pluginInfo = { { 0x88928401, 0x2ce8, 0x4568, { 0xaa, 0xa7, 0x22, 0x61, 0x41, 0x87, 0x0c, 0xbf } } }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Discord", pluginInfoEx) +{ + SetUniqueId(DB_KEY_ID); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -59,7 +65,7 @@ IconItem g_iconList[] = extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pci = Chat_GetInterface(); g_hwndHeartbeat = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 8723c072d5..c47875950f 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -364,9 +364,5 @@ public: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("Discord") - { - SetUniqueId(DB_KEY_ID); - } + CMPlugin(); }; diff --git a/protocols/Dummy/src/dummy.h b/protocols/Dummy/src/dummy.h index 32ddb8d345..2dd22bc769 100644 --- a/protocols/Dummy/src/dummy.h +++ b/protocols/Dummy/src/dummy.h @@ -70,13 +70,5 @@ static const ttemplate templates[] = struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("Dummy") - { - int id = db_get_b(0, m_szModuleName, DUMMY_ID_TEMPLATE, -1); - if (id < 0 || id >= _countof(templates)) - SetUniqueId(ptrA(db_get_sa(0, m_szModuleName, DUMMY_ID_SETTING))); - else - SetUniqueId(templates[id].setting); - } + CMPlugin(); }; diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index 960fd7380b..692df7f35a 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -18,10 +18,11 @@ along with this program. If not, see . #include "stdafx.h" #include "version.h" +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); CLIST_INTERFACE *pcli; -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -35,14 +36,24 @@ PLUGININFOEX pluginInfo = { 0x2a1081d1, 0xaee3, 0x4091, {0xb7, 0xd, 0xae, 0x46, 0xd0, 0x9f, 0x9a, 0x7f}} }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Dummy", pluginInfoEx) +{ + int id = db_get_b(0, m_szModuleName, DUMMY_ID_TEMPLATE, -1); + if (id < 0 || id >= _countof(templates)) + SetUniqueId(ptrA(db_get_sa(0, m_szModuleName, DUMMY_ID_SETTING))); + else + SetUniqueId(templates[id].setting); +} + extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; ///////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - execute some code when all plugins are initialized @@ -57,7 +68,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); @@ -72,16 +83,12 @@ extern "C" int __declspec(dllexport) Unload(void) return 0; } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - ///////////////////////////////////////////////////////////////////////////////////////// // stubs for obsoleted protocols struct CMPluginAim : public ACCPROTOPLUGIN { - CMPluginAim() : ACCPROTOPLUGIN("AIM") + CMPluginAim() : ACCPROTOPLUGIN("AIM", pluginInfoEx) { SetUniqueId("SN"); } @@ -90,7 +97,7 @@ static g_pluginAim; struct CMPluginYahoo : public ACCPROTOPLUGIN { - CMPluginYahoo() : ACCPROTOPLUGIN("YAHOO") + CMPluginYahoo() : ACCPROTOPLUGIN("YAHOO", pluginInfoEx) { SetUniqueId("yahoo_id"); } @@ -99,7 +106,7 @@ static g_pluginYahoo; struct CMPluginTlen : public ACCPROTOPLUGIN { - CMPluginTlen() : ACCPROTOPLUGIN("TLEN") + CMPluginTlen() : ACCPROTOPLUGIN("TLEN", pluginInfoEx) { SetUniqueId("jid"); } @@ -108,7 +115,7 @@ static g_pluginTlen; struct CMPluginXFire : public ACCPROTOPLUGIN { - CMPluginXFire() : ACCPROTOPLUGIN("XFire") + CMPluginXFire() : ACCPROTOPLUGIN("XFire", pluginInfoEx) { SetUniqueId("Username"); } @@ -117,7 +124,7 @@ static g_pluginXFire; struct CMPluginWhatsapp : public ACCPROTOPLUGIN { - CMPluginWhatsapp() : ACCPROTOPLUGIN("WhatsApp") + CMPluginWhatsapp() : ACCPROTOPLUGIN("WhatsApp", pluginInfoEx) { SetUniqueId("ID"); } diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index 43f2bc2c23..b4ed858561 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -18,7 +18,7 @@ std::fstream emlanLog("EmLanLog.txt", std::ios::out|std::ios::app); ////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -31,9 +31,16 @@ PLUGININFOEX pluginInfo = { { 0xe08ce7c4, 0x9eeb, 0x4272, { 0xb5, 0x44, 0xd, 0x32, 0xe1, 0x8d, 0x90, 0xde } } }; +CMPlugin::CMPlugin() : + PLUGIN(PROTONAME, pluginInfoEx) +{ + RegisterProtocol(PROTOTYPE_PROTOCOL); + SetUniqueId("Nick"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* __cdecl MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -328,7 +335,7 @@ INT_PTR CALLBACK EMPDlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA extern "C" int __declspec(dllexport) __cdecl Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); g_lan = new CMLan(); CreateProtoServiceFunction(PROTONAME, PS_GETCAPS, EMPGetCaps); diff --git a/protocols/EmLanProto/src/stdafx.h b/protocols/EmLanProto/src/stdafx.h index 1fc82252ce..30aca9c8a4 100644 --- a/protocols/EmLanProto/src/stdafx.h +++ b/protocols/EmLanProto/src/stdafx.h @@ -27,12 +27,7 @@ struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(PROTONAME) - { - RegisterProtocol(PROTOTYPE_PROTOCOL); - SetUniqueId("Nick"); - } + CMPlugin(); }; //#define VERBOSE diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp index 19c1c54331..5283056a17 100644 --- a/protocols/FacebookRM/src/main.cpp +++ b/protocols/FacebookRM/src/main.cpp @@ -22,12 +22,15 @@ along with this program. If not, see . #include "stdafx.h" +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); std::string g_strUserAgent; DWORD g_mirandaVersion; -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -40,16 +43,18 @@ PLUGININFOEX pluginInfo = { { 0x8432b009, 0xff32, 0x4727, { 0xaa, 0xe6, 0xa9, 0x3, 0x50, 0x38, 0xfd, 0x58 } } }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN(FACEBOOK_NAME, pluginInfoEx) +{ + SetUniqueId(FACEBOOK_KEY_ID); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { g_mirandaVersion = mirandaVersion; - return &pluginInfo; + return &pluginInfoEx; } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - ///////////////////////////////////////////////////////////////////////////////////////// // Interface information @@ -60,7 +65,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); InitIcons(); InitContactMenus(); diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 56a834df6d..7583c2e43e 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -289,9 +289,5 @@ public: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN(FACEBOOK_NAME) - { - SetUniqueId(FACEBOOK_KEY_ID); - } + CMPlugin(); }; diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index f62f56c3be..29e03a727b 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -23,30 +23,45 @@ #include "version.h" #include -// Plugin info -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - // {F3FF65F3-250E-416A-BEE9-58C93F85AB33} - { 0xf3ff65f3, 0x250e, 0x416a, { 0xbe, 0xe9, 0x58, 0xc9, 0x3f, 0x85, 0xab, 0x33 } } -}; - // Other variables SSL_API sslApi; -CLIST_INTERFACE *pcli; +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); +CLIST_INTERFACE *pcli; static unsigned long crc_table[256]; ////////////////////////////////////////////////////////// +// Plugin info -CMPlugin g_plugin; +PLUGININFOEX pluginInfoEx = { + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {F3FF65F3-250E-416A-BEE9-58C93F85AB33} + {0xf3ff65f3, 0x250e, 0x416a, {0xbe, 0xe9, 0x58, 0xc9, 0x3f, 0x85, 0xab, 0x33}} +}; + +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN(GGDEF_PROTO, pluginInfoEx) +{ + crc_gentable(); + SetUniqueId(GG_KEY_UIN); +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} + +////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; ////////////////////////////////////////////////////////// // Extra winsock function for error description @@ -147,23 +162,13 @@ const wchar_t *http_error_string(int h) return TranslateT("Unknown HTTP error"); } -////////////////////////////////////////////////////////// -// Gets plugin info -// -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; - ////////////////////////////////////////////////////////// // Cleanups from last plugin // void GaduProto::cleanuplastplugin(DWORD version) { // Store current plugin version - setDword(GG_PLUGINVERSION, pluginInfo.version); + setDword(GG_PLUGINVERSION, pluginInfoEx.version); //1. clean files: %miranda_avatarcache%\GG\*.(null) if (version < PLUGIN_MAKE_VERSION(0, 11, 0, 2)) { @@ -299,7 +304,7 @@ void GaduProto::OnBuildProtoMenu() // extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, gg_modulesloaded); diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index be94b8cfb9..115fa9f799 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -258,7 +258,7 @@ struct GGGETAVATARDATA struct GaduProto; extern CLIST_INTERFACE *pcli; -extern PLUGININFOEX pluginInfo; +extern PLUGININFOEX pluginInfoEx; extern IconItem iconList[]; extern SSL_API sslApi; diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index cca61e74bb..46f32e1a94 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -74,7 +74,7 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) : hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName); DWORD pluginVersion = getDword(GG_PLUGINVERSION, 0); - if (pluginVersion < pluginInfo.version) + if (pluginVersion < pluginInfoEx.version) cleanuplastplugin(pluginVersion); links_instance_init(); diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 8d9dc100aa..b77a27aee0 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -315,12 +315,7 @@ void crc_gentable(void); struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN(GGDEF_PROTO) - { - crc_gentable(); - SetUniqueId(GG_KEY_UIN); - } + CMPlugin(); }; #endif diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index e71c55b57b..fb3559bedb 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -26,7 +26,7 @@ char protoName[64]; CMPlugin g_plugin; HNETLIBUSER hNetlibUser; -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -38,9 +38,24 @@ PLUGININFOEX pluginInfo = UNICODE_AWARE }; +CMPlugin::CMPlugin() : + PLUGIN(protoName, pluginInfoEx) +{ + char fileName[MAX_PATH]; + GetModuleFileNameA(m_hInst, fileName, MAX_PATH); + + WIN32_FIND_DATAA findData; + FindClose(FindFirstFileA(fileName, &findData)); + findData.cFileName[strlen(findData.cFileName) - 4] = 0; + strncpy_s(protoName, findData.cFileName, _TRUNCATE); + + Proto_RegisterModule(PROTOTYPE_PROTOCOL, protoName); + Proto_SetUniqueId(protoName, "UIN"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ////////////////////////////////////////////////////////////////////////// @@ -52,7 +67,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" __declspec(dllexport) int Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); CMStringA szDescr(FORMAT, "%s connection", protoName); NETLIBUSER nlu = {}; diff --git a/protocols/ICQCorp/src/stdafx.h b/protocols/ICQCorp/src/stdafx.h index d31ba24953..215bb0a9dc 100644 --- a/protocols/ICQCorp/src/stdafx.h +++ b/protocols/ICQCorp/src/stdafx.h @@ -59,18 +59,5 @@ extern int UnloadServices(); struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(protoName) - { - char fileName[MAX_PATH]; - GetModuleFileNameA(m_hInst, fileName, MAX_PATH); - - WIN32_FIND_DATAA findData; - FindClose(FindFirstFileA(fileName, &findData)); - findData.cFileName[strlen(findData.cFileName) - 4] = 0; - strncpy_s(protoName, findData.cFileName, _TRUNCATE); - - Proto_RegisterModule(PROTOTYPE_PROTOCOL, protoName); - Proto_SetUniqueId(protoName, "UIN"); - } + CMPlugin(); }; diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index 8947ca68a2..bc7c19d6b7 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -420,11 +420,7 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("IRC") - { - SetUniqueId("Nick"); - } + CMPlugin(); }; #endif // _IRCPROTO_H_ diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp index 4d22b5dbad..5babb6b3d6 100644 --- a/protocols/IRCG/src/main.cpp +++ b/protocols/IRCG/src/main.cpp @@ -22,24 +22,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" #include "version.h" +CMPlugin g_plugin; +int &hLangpack(g_plugin.m_hLang); CHAT_MANAGER *pci; CLIST_INTERFACE *pcli; -int &hLangpack(g_plugin.m_hLang); +///////////////////////////////////////////////////////////////////////////////////////// -static int CompareServers( const SERVER_INFO* p1, const SERVER_INFO* p2 ) +static int CompareServers(const SERVER_INFO* p1, const SERVER_INFO* p2) { - return mir_strcmp( p1->m_name, p2->m_name ); + return mir_strcmp(p1->m_name, p2->m_name); } -OBJLIST g_servers( 20, CompareServers ); +OBJLIST g_servers(20, CompareServers); -void UninitTimers( void ); +void UninitTimers(void); +///////////////////////////////////////////////////////////////////////////////////////// // Information about the plugin -PLUGININFOEX pluginInfo = + +static PLUGININFOEX pluginInfoEx = { - sizeof( PLUGININFOEX ), + sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), __DESC, @@ -48,17 +52,19 @@ PLUGININFOEX pluginInfo = __AUTHORWEB, UNICODE_AWARE, // {92382B4D-5572-48a0-B0B9-1336A601D689} - { 0x92382b4d, 0x5572, 0x48a0, {0xb0, 0xb9, 0x13, 0x36, 0xa6, 0x1, 0xd6, 0x89 }} + {0x92382b4d, 0x5572, 0x48a0, {0xb0, 0xb9, 0x13, 0x36, 0xa6, 0x1, 0xd6, 0x89}} }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("IRC", pluginInfoEx) { - return &pluginInfo; + SetUniqueId("Nick"); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -68,7 +74,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pci = Chat_GetInterface(); pcli = Clist_GetInterface(); diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index ec5c940eaf..61a9de21b6 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -31,8 +31,6 @@ #include "m_icolib.h" -extern PLUGININFOEX pluginInfo; - #pragma warning(disable:4355) static int CompareConns(const directconnect *p1, const directconnect *p2) diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index e6cce5e4c6..aae9dead64 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -897,11 +897,7 @@ struct CIcqProto : public PROTO struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN(ICQ_PROTOCOL_NAME) - { - SetUniqueId(UNIQUEIDSETTING); - } + CMPlugin(); }; #endif diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index bc84d3d8f5..0ee6885f44 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -34,7 +34,9 @@ BOOL bPopupService = FALSE; HANDLE hExtraXStatus; -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +static PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -46,9 +48,15 @@ PLUGININFOEX pluginInfo = { { 0x73a9615c, 0x7d4e, 0x4555, { 0xba, 0xdb, 0xee, 0x5, 0xdc, 0x92, 0x8e, 0xff } } // {73A9615C-7D4E-4555-BADB-EE05DC928EFF} }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN(ICQ_PROTOCOL_NAME, pluginInfoEx) +{ + SetUniqueId(UNIQUEIDSETTING); +} + extern "C" PLUGININFOEX __declspec(dllexport) *MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -74,7 +82,7 @@ IconItem iconList[] = extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); srand(time(0)); _tzset(); diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 341f5092f0..b8673483c3 100755 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -37,13 +37,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HMODULE hMsftedit; +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); -unsigned int g_nTempFileId; CHAT_MANAGER *pci; int g_cbCountries; CountryListEntry *g_countries; +unsigned int g_nTempFileId; wchar_t szCoreVersion[100]; CLIST_INTERFACE* pcli; @@ -59,11 +60,7 @@ bool bSecureIM, bMirOTR, bNewGPG, bPlatform; ///////////////////////////////////////////////////////////////////////////////////////// -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////////////////// - -PLUGININFOEX pluginInfo = { +static PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -75,9 +72,15 @@ PLUGININFOEX pluginInfo = { { 0x144e80a2, 0xd198, 0x428b, {0xac, 0xbe, 0x9d, 0x55, 0xda, 0xcc, 0x7f, 0xde }} // {144E80A2-D198-428b-ACBE-9D55DACC7FDE} }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("JABBER", pluginInfoEx) +{ + SetUniqueId("jid"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -157,7 +160,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load() { // set the memory, lists & utf8 managers - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pci = Chat_GetInterface(); pcli = Clist_GetInterface(); diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index c36553e268..8da20b0d1a 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -936,11 +936,7 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("JABBER") - { - SetUniqueId("jid"); - } + CMPlugin(); }; #endif diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index 7fb4b0ed55..f129ed4093 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); CLIST_INTERFACE *pcli; @@ -13,6 +14,8 @@ WCHAR g_szMirWorkDirPath[MAX_FILEPATH]; void IconsLoad(); +///////////////////////////////////////////////////////////////////////////////////////// + PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), PROTOCOL_DISPLAY_NAME_ORIGA, @@ -26,6 +29,12 @@ PLUGININFOEX pluginInfoEx = { { 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } } }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("MRA", pluginInfoEx) +{ + SetUniqueId("e-mail"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { return &pluginInfoEx; @@ -33,10 +42,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) ///////////////////////////////////////////////////////////////////////////////////////// -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////////////////// - extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; /////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 80cbec1f33..0221580d3f 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -342,9 +342,5 @@ struct CMraProto : public PROTO struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("MRA") - { - SetUniqueId("e-mail"); - } + CMPlugin(); }; diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index ac39b01399..769c3a7e07 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include "msn_proto.h" #include "version.h" +CMPlugin g_plugin; CLIST_INTERFACE *pcli; int &hLangpack(g_plugin.m_hLang); @@ -39,7 +40,9 @@ void MsnLinks_Destroy(void); bool g_bTerminated = false; int avsPresent = -1; -static const PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +static const PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -53,9 +56,16 @@ static const PLUGININFOEX pluginInfo = {0x97724af9, 0xf3fb, 0x47d3, {0xa3, 0xbf, 0xea, 0xa9, 0x35, 0xc7, 0x4e, 0x6d}} }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("MSN", pluginInfoEx) +{ + ::DisableThreadLibraryCalls(m_hInst); + SetUniqueId("wlid"); +} + extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -63,10 +73,6 @@ extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - ///////////////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - finalizes plugin's configuration on load @@ -83,7 +89,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index da80f418fb..b88e4020bc 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -469,12 +469,7 @@ struct CMsnProto : public PROTO struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("MSN") - { - ::DisableThreadLibraryCalls(m_hInst); - SetUniqueId("wlid"); - } + CMPlugin(); }; #endif diff --git a/protocols/MinecraftDynmap/src/main.cpp b/protocols/MinecraftDynmap/src/main.cpp index c50d2766c6..37987fa53a 100644 --- a/protocols/MinecraftDynmap/src/main.cpp +++ b/protocols/MinecraftDynmap/src/main.cpp @@ -22,13 +22,13 @@ along with this program. If not, see . #include "stdafx.h" +CMPlugin g_plugin; CLIST_INTERFACE* pcli; int &hLangpack(g_plugin.m_hLang); std::string g_strUserAgent; -DWORD g_mirandaVersion; -PLUGININFOEX pluginInfo = { +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -41,16 +41,15 @@ PLUGININFOEX pluginInfo = { { 0x40da5ebd, 0x4f2d, 0x4bea, 0x84, 0x1c, 0xea, 0xb7, 0x7b, 0xee, 0x6f, 0x4f } }; -///////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - -///////////////////////////////////////////////////////////////////////////// +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("MinecraftDynmap", pluginInfoEx) +{ + SetUniqueId("Nick"); +} -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - g_mirandaVersion = mirandaVersion; - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -65,22 +64,17 @@ static HANDLE g_hEvents[1]; extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); InitIcons(); // Init native User-Agent { + MFileVersion w; + Miranda_GetFileVersion(&w); std::stringstream agent; - agent << "Miranda NG/"; - agent << ((g_mirandaVersion >> 24) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 16) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion >> 8) & 0xFF); - agent << "."; - agent << ((g_mirandaVersion ) & 0xFF); + agent << "Miranda NG/" << w[0] << "." << w[1] << "." << w[2] << "." << w[3]; #ifdef _WIN64 agent << " Minecraft Dynmap Protocol x64/"; #else diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h index 00e7803932..b6d7bc9273 100644 --- a/protocols/MinecraftDynmap/src/proto.h +++ b/protocols/MinecraftDynmap/src/proto.h @@ -129,9 +129,5 @@ public: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("MinecraftDynmap") - { - SetUniqueId("Nick"); - } + CMPlugin(); }; diff --git a/protocols/MinecraftDynmap/src/stdafx.h b/protocols/MinecraftDynmap/src/stdafx.h index d47e51733c..cfc8d05529 100644 --- a/protocols/MinecraftDynmap/src/stdafx.h +++ b/protocols/MinecraftDynmap/src/stdafx.h @@ -71,4 +71,3 @@ class MinecraftDynmapProto; #include "resource.h" extern std::string g_strUserAgent; -extern DWORD g_mirandaVersion; diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index 3dcb03603c..14bff0f0ae 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -24,13 +24,16 @@ along with this program. If not, see . // TODO: Make following as "globals" structure? +CMPlugin g_plugin; CLIST_INTERFACE* pcli; int &hLangpack(g_plugin.m_hLang); std::string g_strUserAgent; DWORD g_mirandaVersion; -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -43,16 +46,18 @@ PLUGININFOEX pluginInfo = { { 0x9e1d9244, 0x606c, 0x4ef4, { 0x99, 0xa0, 0x1d, 0x7d, 0x23, 0xcb, 0x76, 0x1 } } }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Omegle", pluginInfoEx) +{ + SetUniqueId("Nick"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { g_mirandaVersion = mirandaVersion; - return &pluginInfo; + return &pluginInfoEx; } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; - ///////////////////////////////////////////////////////////////////////////////////////// // Interface information @@ -63,7 +68,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); InitIcons(); diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index dd81adcaad..d36c1862bf 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -104,9 +104,5 @@ public: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("Omegle") - { - SetUniqueId("Nick"); - } + CMPlugin(); }; diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 751bd183d0..78d48d161b 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -6,7 +6,7 @@ int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -20,9 +20,15 @@ PLUGININFOEX pluginInfo = { 0xf1b0ba1b, 0xc91, 0x4313, { 0x85, 0xeb, 0x22, 0x50, 0x69, 0xd4, 0x4d, 0x1 } } }; +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Sametime", pluginInfoEx) +{ + SetUniqueId("stid"); +} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -232,7 +238,7 @@ void CSametimeProto::BroadcastNewStatus(int iNewStatus) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); return 0; } diff --git a/protocols/Sametime/src/sametime.h b/protocols/Sametime/src/sametime.h index ccf1c920e8..ca84829906 100644 --- a/protocols/Sametime/src/sametime.h +++ b/protocols/Sametime/src/sametime.h @@ -112,8 +112,6 @@ typedef struct FileTransferClientData_tag { // Global variables struct CSametimeProto; -extern PLUGININFOEX pluginInfo; - #include "sametime_proto.h" diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 242f68cf6c..bb043f5ff9 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -193,11 +193,7 @@ struct CSametimeProto : public PROTO struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("Sametime") - { - SetUniqueId("stid"); - } + CMPlugin(); }; struct SendAnnouncementFunc_arg diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp index 1ff515f2b4..c390774d13 100644 --- a/protocols/SkypeWeb/src/main.cpp +++ b/protocols/SkypeWeb/src/main.cpp @@ -17,13 +17,17 @@ along with this program. If not, see . #include "stdafx.h" -int &hLangpack(g_plugin.m_hLang); +CMPlugin g_plugin; +CHAT_MANAGER *pci; CLIST_INTERFACE *pcli; +int &hLangpack(g_plugin.m_hLang); + char g_szMirVer[100]; HANDLE g_hCallEvent; -CHAT_MANAGER *pci; -PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -37,14 +41,16 @@ PLUGININFOEX pluginInfo = { 0x57e90ac6, 0x1067, 0x423b, { 0x8c, 0xa3, 0x70, 0xa3, 0x9d, 0x20, 0xd, 0x4f } } }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("SKYPE", pluginInfoEx) { - return &pluginInfo; + SetUniqueId(SKYPE_SETTINGS_ID); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -63,7 +69,7 @@ int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); pci = Chat_GetInterface(); Miranda_GetVersionText(g_szMirVer, sizeof(g_szMirVer)); diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 2950141d96..43db460dfe 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -421,11 +421,7 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("SKYPE") - { - SetUniqueId(SKYPE_SETTINGS_ID); - } + CMPlugin(); }; #endif //_SKYPE_PROTO_H_ \ No newline at end of file diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index cbe75d5100..1b7be830aa 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -1,10 +1,13 @@ #include "stdafx.h" +CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); HANDLE hExtraXStatus; -PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -18,14 +21,16 @@ PLUGININFOEX pluginInfo = { 0x68f5a030, 0xba32, 0x48ec, { 0x95, 0x7, 0x5c, 0x2f, 0xbd, 0xea, 0x52, 0x17 }} }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("STEAM", pluginInfoEx) { - return &pluginInfo; + SetUniqueId("SteamID"); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -35,7 +40,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); char iconName[100]; mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 4298d45737..39c1b7a2be 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -276,11 +276,7 @@ protected: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("STEAM") - { - SetUniqueId("SteamID"); - } + CMPlugin(); }; int OnReloadIcons(WPARAM wParam, LPARAM lParam); diff --git a/protocols/Tox/src/main.cpp b/protocols/Tox/src/main.cpp index 593d598485..8f1b12b730 100644 --- a/protocols/Tox/src/main.cpp +++ b/protocols/Tox/src/main.cpp @@ -1,11 +1,15 @@ #include "stdafx.h" -int &hLangpack(g_plugin.m_hLang); +CMPlugin g_plugin; CHAT_MANAGER *pci; CLIST_INTERFACE *pcli; +int &hLangpack(g_plugin.m_hLang); + HANDLE hProfileFolderPath; -PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -19,14 +23,16 @@ PLUGININFOEX pluginInfo = {0x272a3e, 0xf5fa, 0x4090, {0x8b, 0x67, 0x3e, 0x62, 0xac, 0x1e, 0xe0, 0xb4}} }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("TOX", pluginInfoEx) { - return &pluginInfo; + SetUniqueId(TOX_SETTINGS_ID); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -50,7 +56,7 @@ int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pci = Chat_GetInterface(); pcli = Clist_GetInterface(); diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 3a67298871..5af4c0bddf 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -248,11 +248,7 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("TOX") - { - SetUniqueId(TOX_SETTINGS_ID); - } + CMPlugin(); }; #endif //_TOX_PROTO_H_ \ No newline at end of file diff --git a/protocols/Twitter/src/main.cpp b/protocols/Twitter/src/main.cpp index afe7e21ae7..15eaa69f1d 100644 --- a/protocols/Twitter/src/main.cpp +++ b/protocols/Twitter/src/main.cpp @@ -22,11 +22,13 @@ along with this program. If not, see . #include "proto.h" #include "theme.h" +CMPlugin g_plugin; CLIST_INTERFACE *pcli; - int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), @@ -39,14 +41,16 @@ PLUGININFOEX pluginInfo = { { 0xbc09a71b, 0xb86e, 0x4d33, { 0xb1, 0x8d, 0x82, 0xd3, 0x4, 0x51, 0xdd, 0x3c } } }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Twitter", pluginInfoEx) { - return &pluginInfo; + SetUniqueId(TWITTER_KEY_UN); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -57,7 +61,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); InitIcons(); diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 077f105a6d..fe84da9742 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -129,11 +129,7 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("Twitter") - { - SetUniqueId(TWITTER_KEY_UN); - } + CMPlugin(); }; // TODO: remove this diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index 3861ba254d..76edf4e37c 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -18,10 +18,13 @@ along with this program. If not, see . #include "stdafx.h" #include "version.h" -int &hLangpack(g_plugin.m_hLang); +CMPlugin g_plugin; CLIST_INTERFACE *pcli; +int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -35,14 +38,16 @@ PLUGININFOEX pluginInfo = { 0x32579908, 0x724b, 0x467f, {0xad, 0xad, 0x22, 0xb6, 0x35, 0x9a, 0x74, 0x9a}} }; -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("VKontakte", pluginInfoEx) { - return &pluginInfo; + SetUniqueId("ID"); } -///////////////////////////////////////////////////////////////////////////////////////// - -CMPlugin g_plugin; +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} ///////////////////////////////////////////////////////////////////////////////////////// @@ -53,7 +58,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC extern "C" int __declspec(dllexport) Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); InitIcons(); diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index f1fd68ba43..e1e032e5b9 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -403,9 +403,5 @@ private: struct CMPlugin : public ACCPROTOPLUGIN { - CMPlugin() : - ACCPROTOPLUGIN("VKontakte") - { - SetUniqueId("ID"); - } + CMPlugin(); }; -- cgit v1.2.3