From 7e8aa70c724e6b72817cba090b7b178fd7f86341 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 22 Mar 2016 17:32:31 +0000 Subject: fixes bug #1104 (wrong cache implementation in clist_modern) git-svn-id: http://svn.miranda-ng.org/main/trunk@16523 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcitems.cpp | 8 ++++++- plugins/Clist_modern/src/modern_clistsettings.cpp | 26 ++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index ea1a517577..f080b24bc5 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -174,7 +174,6 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, cont->flags |= CONTACTF_ONLINE; WORD apparentMode = szProto != NULL ? cacheEntry->ApparentMode : 0; - if (apparentMode) switch (apparentMode) { case ID_STATUS_OFFLINE: @@ -618,6 +617,13 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact) p->hContact = hContact; InvalidateDNCEbyPointer(hContact, p, 0); + + p->bIsHidden = -1; + p->m_cache_nNoHiddenOffline = -1; + p->IdleTS = -1; + p->NotOnList = -1; + p->IsExpanded = -1; + p->szSecondLineText = NULL; p->szThirdLineText = NULL; p->ssSecondLine.plText = NULL; diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 0fb345ac7e..0934d0af3e 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -290,15 +290,8 @@ void InvalidateDNCEbyPointer(MCONTACT hContact, ClcCacheEntry *pdnce, int Settin // in other cases clear all binary cache else pdnce->dwLastMsgTime = -1; - pdnce->bIsHidden = -1; pdnce->m_bIsSub = pdnce->m_bProtoNotExists = false; pdnce->m_cache_nStatus = 0; - pdnce->IdleTS = -1; - pdnce->ApparentMode = -1; - pdnce->NotOnList = -1; - pdnce->isUnknown = FALSE; - pdnce->m_cache_nNoHiddenOffline = -1; - pdnce->IsExpanded = -1; } char *GetContactCachedProtocol(MCONTACT hContact) @@ -399,9 +392,6 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szModule, pdnce->m_cache_cszProto)) { InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type); - if (!strcmp(cws->szSetting, "IsSubcontact")) - pcli->pfnInitAutoRebuild(pcli->hwndContactTree); - if (!strcmp(cws->szSetting, "Status") || wildcmp(cws->szSetting, "Status?")) { if (!strcmp(cws->szModule, META_PROTO) && strcmp(cws->szSetting, "Status")) { if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled) @@ -427,6 +417,12 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) pcli->pfnClcBroadcast(INTM_STATUSCHANGED, hContact, 0); cli_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact), 0); //by FYR } + else if (!strcmp(cws->szSetting, "ApparentMode")) + pdnce->ApparentMode = cws->value.wVal; + else if (!strcmp(cws->szSetting, "IdleTS")) + pdnce->IdleTS = cws->value.dVal; + else if (!strcmp(cws->szSetting, "IsSubcontact")) + pcli->pfnInitAutoRebuild(pcli->hwndContactTree); } if (!strcmp(cws->szModule, "CList")) { @@ -440,8 +436,14 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(cws->szSetting, "Group")) InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type); + else if (!strcmp(cws->szSetting, "NotOnList")) + pdnce->NotOnList = cws->value.bVal; + + else if (!strcmp(cws->szSetting, "Expanded")) + pdnce->IsExpanded = cws->value.bVal; + else if (!strcmp(cws->szSetting, "Hidden")) { - InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type); + pdnce->bIsHidden = cws->value.bVal; if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) { char *szProto = GetContactProto(hContact); cli_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(szProto, @@ -450,7 +452,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); } else if (!strcmp(cws->szSetting, "noOffline")) { - InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type); + pdnce->m_cache_nNoHiddenOffline = cws->value.bVal; pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); } } -- cgit v1.2.3