From 1f59c3aa32a110178d221945f362e30763cfe686 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Apr 2018 23:08:08 +0200 Subject: completely fixes #1294 even if offline contacts are shown --- src/mir_app/src/clc.h | 2 ++ src/mir_app/src/clistmod.cpp | 1 + src/mir_app/src/clistsettings.cpp | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 2abed41833..7ae01bd796 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -97,6 +97,8 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam); void RebuildMenuOrder(void); /* clistsettings.c */ +void InvalidateProtoInCache(const char *szModuleName); + void fnGetDefaultFontSetting(int i, LOGFONT *lf, COLORREF * colour); void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact); diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index a7f6fbf932..8dd4488972 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -173,6 +173,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) break; case PRAC_REMOVED: + InvalidateProtoInCache(pa->szModuleName); pa->iIconBase = -1; break; } diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index ef7dc74b7b..68e4f765f8 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -37,6 +37,13 @@ void FreeDisplayNameCache(void) clistCache.destroy(); } +void InvalidateProtoInCache(const char *szModuleName) +{ + for (auto &it : clistCache) + if (!mir_strcmp(it->szProto, szModuleName)) + it->szProto = nullptr; +} + // default handlers for the cache item creation and destruction ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact) -- cgit v1.2.3