From 104ac4660fbd90f36dd76f6082122ab42983224d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Feb 2015 19:33:47 +0000 Subject: fix for settting previos status value in NAS git-svn-id: http://svn.miranda-ng.org/main/trunk@12169 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewAwaySysMod/src/AwaySys.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins/NewAwaySysMod') 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); -- cgit v1.2.3