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 --- src/core/stdautoaway/src/autoaway.cpp | 6 +++--- src/core/stdautoaway/src/main.cpp | 18 +++++++++++++++--- src/core/stdautoaway/src/stdafx.h | 6 ++---- 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src/core/stdautoaway') diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index c5cf316d36..b926c740f2 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -71,16 +71,16 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) continue; // save old status of account and set to given status - db_set_w(NULL, AA_MODULE, pa->szModuleName, pa->iRealStatus); + db_set_w(NULL, MODULENAME, pa->szModuleName, pa->iRealStatus); Proto_SetStatus(pa->szModuleName, status); } else { - int oldstatus = db_get_w(NULL, AA_MODULE, pa->szModuleName, 0); + int oldstatus = db_get_w(NULL, MODULENAME, pa->szModuleName, 0); if (oldstatus != ID_STATUS_ONLINE && oldstatus != ID_STATUS_FREECHAT) continue; // returning from idle and this accout was set away, set it back - db_unset(NULL, AA_MODULE, pa->szModuleName); + db_unset(NULL, MODULENAME, pa->szModuleName); if (!mii.aaLock) Proto_SetStatus(pa->szModuleName, oldstatus); } diff --git a/src/core/stdautoaway/src/main.cpp b/src/core/stdautoaway/src/main.cpp index e3270fd02d..bc5d1d89ea 100644 --- a/src/core/stdautoaway/src/main.cpp +++ b/src/core/stdautoaway/src/main.cpp @@ -26,7 +26,9 @@ int LoadAutoAwayModule(void); CMPlugin g_plugin; int &hLangpack(g_plugin.m_hLang); -PLUGININFOEX pluginInfo = { +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, MIRANDA_VERSION_DWORD, @@ -39,21 +41,31 @@ PLUGININFOEX pluginInfo = { { 0x9f5ca736, 0x1108, 0x4872, {0xbe, 0xc3, 0x19, 0xc8, 0x4b, 0xc2, 0x14, 0x3b}} }; +CMPlugin::CMPlugin() : + PLUGIN(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AUTOAWAY, MIID_LAST }; +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Load(void) { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); LoadAutoAwayModule(); return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + extern "C" int __declspec(dllexport) Unload(void) { return 0; diff --git a/src/core/stdautoaway/src/stdafx.h b/src/core/stdautoaway/src/stdafx.h index d785f0f238..0587b8148c 100644 --- a/src/core/stdautoaway/src/stdafx.h +++ b/src/core/stdautoaway/src/stdafx.h @@ -65,11 +65,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../../mir_app/src/resource.h" -#define AA_MODULE "AutoAway" +#define MODULENAME "AutoAway" struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(AA_MODULE) - {} + CMPlugin(); }; -- cgit v1.2.3