From 01ff549a2303122360f819c3344ff8a374839d82 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Apr 2016 12:43:33 +0000 Subject: further junk cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@16717 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_clistsettings.cpp | 26 ++++++----------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'plugins/Clist_modern/src/modern_clistsettings.cpp') diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index 83f3ac0478..5586f5cba8 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -243,15 +243,6 @@ void IvalidateDisplayNameCache() } } -char* GetContactCachedProtocol(MCONTACT hContact) -{ - ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact); - if (cacheEntry && cacheEntry->m_pszProto) - return cacheEntry->m_pszProto; - - return NULL; -} - int GetStatusForContact(MCONTACT hContact, char *szProto) { return (szProto) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : ID_STATUS_OFFLINE; @@ -259,8 +250,7 @@ int GetStatusForContact(MCONTACT hContact, char *szProto) int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status) { - ClcCacheEntry *cacheEntry = NULL; - cacheEntry = pcli->pfnGetCacheEntry(hContact); + ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact); if (cacheEntry != NULL) { if (Proto != NULL) *Proto = cacheEntry->m_pszProto; if (Name != NULL) *Name = cacheEntry->tszName; @@ -277,7 +267,7 @@ int GetContactCachedStatus(MCONTACT hContact) int ContactAdded(WPARAM hContact, LPARAM) { if (!MirandaExiting()) - pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode((char*)GetContactCachedProtocol(hContact), ID_STATUS_OFFLINE, hContact), 1); ///by FYR + pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact)); return 0; } @@ -320,7 +310,6 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) amRequestAwayMsg(hContact); pcli->pfnClcBroadcast(INTM_STATUSCHANGED, hContact, 0); - pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact), 0); //by FYR } else if (!strcmp(cws->szModule, META_PROTO) && !memcmp(cws->szSetting, "Status", 6)) { // Status0..N for metacontacts if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled) @@ -352,11 +341,9 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) else if (!strcmp(cws->szSetting, "Hidden")) { pdnce->bIsHidden = cws->value.bVal; - if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) { - char *szProto = GetContactProto(hContact); - pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(szProto, - szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1); //by FYR - } + if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) + pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(pdnce->m_pszProto, pdnce->getStatus(), hContact)); + pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0); } else if (!strcmp(cws->szSetting, "noOffline")) { @@ -368,8 +355,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (!strcmp(cws->szSetting, "p")) { pdnce->m_pszProto = GetContactProto(hContact); char *szProto = (cws->value.type == DBVT_DELETED) ? NULL : cws->value.pszVal; - pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(szProto, - szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 0); + pcli->pfnChangeContactIcon(hContact, pcli->pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact)); } } -- cgit v1.2.3