summaryrefslogtreecommitdiff
path: root/plugins/NewAwaySysMod
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-02-17 19:33:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-02-17 19:33:47 +0000
commit104ac4660fbd90f36dd76f6082122ab42983224d (patch)
tree9ca1d6e278264d958db10f81fe59391ffdd7acab /plugins/NewAwaySysMod
parent55f35dfeb29dad88855eb89e964bf94deb980a61 (diff)
fix for settting previos status value in NAS
git-svn-id: http://svn.miranda-ng.org/main/trunk@12169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewAwaySysMod')
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 2da6d364d3..0844fad72d 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -350,6 +350,14 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM)
return 0;
}
+static int DBSettingChanged(WPARAM hContact, LPARAM lParam)
+{
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if (hContact != NULL && !strcmp(cws->szSetting, "Status"))
+ db_set_w(hContact, "UserOnline", "OldStatus", cws->value.wVal);
+
+ return 0;
+}
static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM)
{
@@ -605,6 +613,7 @@ int MirandaLoaded(WPARAM, LPARAM)
HookEvent(ME_OPT_INITIALISE, OptsDlgInit);
HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChanged);
HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange); // for compatibility with StartupStatus and AdvancedAutoAway
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DBSettingChanged);
HookEvent(ME_DB_EVENT_FILTER_ADD, MsgEventAdded);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);
HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);