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 --- plugins/StatusManager/src/KeepStatus/keepstatus.cpp | 2 +- plugins/StatusManager/src/StartupStatus/startupstatus.cpp | 3 +-- plugins/StatusManager/src/commonstatus.cpp | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/StatusManager/src') diff --git a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp index 95164b9d67..e9b45a9461 100644 --- a/plugins/StatusManager/src/KeepStatus/keepstatus.cpp +++ b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp @@ -730,7 +730,7 @@ static void CheckContinuouslyFunction(void *) if (!IsSuitableProto(pa)) continue; - if (IsStatusConnecting(CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0))) { + if (IsStatusConnecting(pa->iRealStatus)) { log_debugA("CheckContinuouslyFunction: %s is connecting", pa->szModuleName); continue; // connecting, leave alone } diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp index 793276ff6a..1b0cdb1de5 100644 --- a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp @@ -237,8 +237,7 @@ static int OnOkToExit(WPARAM, LPARAM) if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG)) continue; - int status = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); - if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status))) + if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(pa->iRealStatus))) continue; // NewAwaySys diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp index 9bcfff4d89..d928e53bde 100644 --- a/plugins/StatusManager/src/commonstatus.cpp +++ b/plugins/StatusManager/src/commonstatus.cpp @@ -37,7 +37,7 @@ SMProto::SMProto(PROTOACCOUNT *pa) { m_szName = pa->szModuleName; m_tszAccName = pa->tszAccountName; - m_status = m_lastStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); + m_status = m_lastStatus = pa->iRealStatus; } SMProto::SMProto(const SMProto &p) @@ -161,11 +161,11 @@ static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) pstatus = GetActualStatus(ps[j]); if (pstatus == 0) - pstatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); + pstatus = pa->iRealStatus; if (db_get_b(0, pa->szModuleName, "LockMainStatus", 0)) { // if proto is locked, pstatus must be the current status - if (pstatus != CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0)) + if (pstatus != pa->iRealStatus) return 0; } else { -- cgit v1.2.3