summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-07 18:44:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-07 18:44:31 +0300
commit5565e5b9839eea8a57e9c46f87e611dd546c8b46 (patch)
tree97156edbfa1bff3d2a8e50e8ba828aa90298eb42 /src/core
parent05e6fa41a1eb29e07060cc540fdde3ba58686f6c (diff)
status caching moved from MenuItem to PROTOACCOUNT - this is very effective
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdautoaway/src/autoaway.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp
index af0a60e441..3dda6e2d87 100644
--- a/src/core/stdautoaway/src/autoaway.cpp
+++ b/src/core/stdautoaway/src/autoaway.cpp
@@ -61,7 +61,6 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam)
if (!pa->IsEnabled() || pa->IsLocked())
continue;
- int currentstatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
int statusbits = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0);
int status = mii.aaStatus;
if (!(statusbits & Proto_Status2Flag(status))) {
@@ -70,11 +69,11 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam)
status = ID_STATUS_AWAY;
}
if (lParam & IDF_ISIDLE) {
- if (currentstatus != ID_STATUS_ONLINE && currentstatus != ID_STATUS_FREECHAT)
+ if (pa->iRealStatus != ID_STATUS_ONLINE && pa->iRealStatus != ID_STATUS_FREECHAT)
continue;
// save old status of account and set to given status
- db_set_w(NULL, AA_MODULE, pa->szModuleName, currentstatus);
+ db_set_w(NULL, AA_MODULE, pa->szModuleName, pa->iRealStatus);
Proto_SetStatus(pa->szModuleName, status);
}
else {