From 5565e5b9839eea8a57e9c46f87e611dd546c8b46 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Apr 2018 18:44:31 +0300 Subject: status caching moved from MenuItem to PROTOACCOUNT - this is very effective --- src/core/stdautoaway/src/autoaway.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core') 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 { -- cgit v1.2.3