summaryrefslogtreecommitdiff
path: root/src/core/stdautoaway
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /src/core/stdautoaway
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'src/core/stdautoaway')
-rw-r--r--src/core/stdautoaway/src/autoaway.cpp6
-rw-r--r--src/core/stdautoaway/src/main.cpp18
-rw-r--r--src/core/stdautoaway/src/stdafx.h6
3 files changed, 20 insertions, 10 deletions
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<CMPlugin>(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>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(AA_MODULE)
- {}
+ CMPlugin();
};