summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
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 /plugins/Clist_modern
parent05e6fa41a1eb29e07060cc540fdde3ba58686f6c (diff)
status caching moved from MenuItem to PROTOACCOUNT - this is very effective
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index 852998e235..5fc46485f4 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -84,19 +84,19 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM, LPARAM)
int connectingCount = 0;
g_bMultiConnectionMode = false;
- for (auto &it : *pcli->menuProtos) {
- if (!Clist_GetProtocolVisibility(it->szProto))
+ for (auto &it : Accounts()) {
+ if (!it->IsVisible())
continue;
- if (IsStatusConnecting(it->iStatus)) {
+ if (IsStatusConnecting(it->iRealStatus)) {
connectingCount++;
if (connectingCount == 1)
- g_szConnectingProto = it->szProto;
+ g_szConnectingProto = it->szModuleName;
else
g_bMultiConnectionMode = true;
}
- else if (GetStatusVal(it->iStatus) > GetStatusVal(curstatus))
- curstatus = it->iStatus;
+ else if (GetStatusVal(it->iRealStatus) > GetStatusVal(curstatus))
+ curstatus = it->iRealStatus;
}
return curstatus ? curstatus : ID_STATUS_OFFLINE;
@@ -276,14 +276,13 @@ static int GetGoodAccNum(bool *bDiffers, bool *bConn = nullptr)
continue;
res++;
- int iStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0);
if (!iPrevStatus)
- iPrevStatus = iStatus;
- else if (iPrevStatus != iStatus)
+ iPrevStatus = pa->iRealStatus;
+ else if (iPrevStatus != pa->iRealStatus)
*bDiffers = true;
if (bConn)
- if (IsStatusConnecting(iStatus))
+ if (IsStatusConnecting(pa->iRealStatus))
*bConn = true;
}