diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-07 18:44:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-07 18:44:31 +0300 |
commit | 5565e5b9839eea8a57e9c46f87e611dd546c8b46 (patch) | |
tree | 97156edbfa1bff3d2a8e50e8ba828aa90298eb42 /plugins/StatusManager/src | |
parent | 05e6fa41a1eb29e07060cc540fdde3ba58686f6c (diff) |
status caching moved from MenuItem to PROTOACCOUNT - this is very effective
Diffstat (limited to 'plugins/StatusManager/src')
-rw-r--r-- | plugins/StatusManager/src/KeepStatus/keepstatus.cpp | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/startupstatus.cpp | 3 | ||||
-rw-r--r-- | plugins/StatusManager/src/commonstatus.cpp | 6 |
3 files changed, 5 insertions, 6 deletions
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 { |