From adf7fec7b1e32e93998e08cd41e9d84852db1758 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Apr 2016 13:39:41 +0000 Subject: clist_modern: - fix for a nightmare with contsct renaming; - end of a crutch with caching 'Unknown contact'; - cache control over the contact's name went to the core; - code cleaning; - version bump; git-svn-id: http://svn.miranda-ng.org/main/trunk@16596 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clcitems.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clcitems.cpp') diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 087d67ab56..d9d6b31f46 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -137,7 +137,7 @@ void cli_FreeContact(ClcContact *p) corecli.pfnFreeContact(p); } -void cli_FreeGroup(ClcGroup* group) +void cli_FreeGroup(ClcGroup *group) { corecli.pfnFreeGroup(group); ClearRowByIndexCache(); @@ -622,13 +622,13 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact) void cliInvalidateDisplayNameCacheEntry(MCONTACT hContact) { - if (hContact == INVALID_CONTACT_ID) - corecli.pfnInvalidateDisplayNameCacheEntry(INVALID_CONTACT_ID); - else { + if (hContact != INVALID_CONTACT_ID) { ClcCacheEntry *p = pcli->pfnGetCacheEntry(hContact); if (p) p->m_iStatus = 0; } + + corecli.pfnInvalidateDisplayNameCacheEntry(hContact); } void cli_SetContactCheckboxes(ClcContact *cc, int checked) @@ -687,12 +687,14 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc TCHAR szGroupMask[256]; DWORD dwLocalMask; ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact); - // always hide subcontacts (but show them on embedded contact lists) + // always hide subcontacts (but show them on embedded contact lists) if (dat != NULL && dat->IsMetaContactsEnabled && db_mc_isSub(hContact)) return -1; //subcontact + if (pdnce && pdnce->m_bIsUnknown && dat != NULL && !dat->force_in_dialog) return 1; //'Unknown Contact' + if (dat != NULL && dat->filterSearch && pdnce && pdnce->tszName) { // search filtering TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(pdnce->tszName)); -- cgit v1.2.3