summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-05 18:53:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-05 18:53:27 +0000
commitd1176fc486363ba31261792ac1ac0f2b4e2895ac (patch)
tree5090333cccbb3c39e57d9eb6c8b87309e8ff0893 /src/modules
parent622d5101fe221d6839c859e0a643259f2cc474c9 (diff)
locked protos shall not affect average status
git-svn-id: http://svn.miranda-ng.org/main/trunk@6794 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/clist/clistmenus.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 85bb7f799b..cbb8f97b92 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -159,8 +159,8 @@ int fnGetAverageMode(int *pNetProtoCount)
int averageMode = 0;
for (int i=0; i < accounts.getCount(); i++) {
- PROTOACCOUNT* pa = accounts[i];
- if (cli.pfnGetProtocolVisibility(pa->szModuleName) == 0)
+ PROTOACCOUNT *pa = accounts[i];
+ if (cli.pfnGetProtocolVisibility(pa->szModuleName) == 0 || Proto_IsAccountLocked(pa))
continue;
netProtoCount++;
@@ -562,16 +562,16 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM)
PMO_IntMenuItem pimi;
char *prot = smep->proto;
char szHumanName[64] = {0};
- PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
- int i = (db_get_b(NULL, prot, "LockMainStatus", 0)?0:1);
- db_set_b(NULL, prot, "LockMainStatus", (BYTE)i);
+ PROTOACCOUNT *acc = Proto_GetAccount(smep->proto);
+ bool bIsLocked = !Proto_IsAccountLocked(acc);
+ db_set_b(NULL, prot, "LockMainStatus", bIsLocked);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
pimi = MO_GetIntMenuItem((HGENMENU)smep->protoindex);
PMO_IntMenuItem root = (PMO_IntMenuItem)pimi->mi.root;
mir_free(pimi->mi.pszName);
mir_free(root->mi.pszName);
- if (i) {
+ if (bIsLocked) {
TCHAR buf[256];
pimi->mi.flags |= CMIF_CHECKED;
if (cli.bDisplayLocked) {