From 3bb16e798cb51d5764aacbefd4edf26f52d8c4f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 4 Dec 2019 16:08:03 +0300 Subject: GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName --- plugins/Clist_modern/src/modern_awaymsg.cpp | 2 +- plugins/Clist_modern/src/modern_cachefuncs.cpp | 2 +- plugins/Clist_modern/src/modern_clc.cpp | 2 +- plugins/Clist_modern/src/modern_clcitems.cpp | 6 +++--- plugins/Clist_modern/src/modern_clistevents.cpp | 2 +- plugins/Clist_modern/src/modern_clistsettings.cpp | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 05102aff2a..a8fc05a682 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -144,7 +144,7 @@ void amRequestAwayMsg(MCONTACT hContact) return; //Do not re-ask for chat rooms - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto != nullptr && !db_get_b(hContact, szProto, "ChatRoom", 0)) amAddHandleToChain(hContact); } diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index cb9afa6e86..a011f8e511 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -192,7 +192,7 @@ void CSmileyString::ReplaceSmileys(ClcData *dat, ClcCacheEntry *pdnce, wchar_t * if (db_get_b(0, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->szProto != nullptr && mir_strcmp(pdnce->szProto, META_PROTO) == 0) { MCONTACT hContact = db_mc_getMostOnline(pdnce->hContact); if (hContact != 0) - sp.Protocolname = GetContactProto(hContact); + sp.Protocolname = Proto_GetBaseAccountName(hContact); } } else sp.Protocolname = "clist"; diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index ba22aacff4..2d79ea46c0 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1338,7 +1338,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam ClcGroup *selgroup; ClcContact *selcontact = nullptr; - char *szProto = GetContactProto(wParam); + char *szProto = Proto_GetBaseAccountName(wParam); WORD status = (szProto == nullptr) ? ID_STATUS_OFFLINE : GetContactCachedStatus(wParam); bool bImageIsSpecial = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index f77e7ebf9f..781f13a78d 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -325,7 +325,7 @@ ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact) return nullptr; pdnce->hContact = hContact; - pdnce->szProto = GetContactProto(hContact); + pdnce->szProto = Proto_GetBaseAccountName(hContact); pdnce->bIsHidden = Contact_IsHidden(hContact); pdnce->m_bIsSub = db_mc_isSub(hContact) != 0; pdnce->m_bNoHiddenOffline = g_plugin.getByte(hContact, "noOffline"); @@ -417,7 +417,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) if (pdnce && g_CluiData.bFilterEffective && dat != nullptr && !dat->bForceInDialog) { if (szProto == nullptr) - szProto = GetContactProto(hContact); + szProto = Proto_GetBaseAccountName(hContact); // check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set). if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS) { if (DWORD dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) { @@ -435,7 +435,7 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, ClcData *dat) mir_snprintf(szTemp, "%s|", szProto); if (db_mc_isMeta(hContact)) { for (int i = db_mc_getSubCount(hContact) - 1; i >= 0; i--) { - mir_snprintf(szTemp, "%s|", GetContactProto(db_mc_getSub(hContact, i))); + mir_snprintf(szTemp, "%s|", Proto_GetBaseAccountName(db_mc_getSub(hContact, i))); if (strstr(g_CluiData.protoFilter, szTemp) != 0) { filterResult = 1; break; diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 882c16f3df..4b0e1ef024 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -108,7 +108,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) } } - char *szProto = GetContactProto(p->hContact); + char *szProto = Proto_GetBaseAccountName(p->hContact); wchar_t *szName = Clist_GetContactDisplayName(p->hContact); if (szProto && szName) { NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData)); diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index e5cb54cb52..5aeca061f2 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -49,7 +49,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) } if (pdnce->szProto == nullptr) { - pdnce->szProto = GetContactProto(pdnce->hContact); + pdnce->szProto = Proto_GetBaseAccountName(pdnce->hContact); if (pdnce->szProto && pdnce->tszName) mir_free_and_nil(pdnce->tszName); } @@ -96,7 +96,7 @@ int GetContactCachedStatus(MCONTACT hContact) int ContactAdded(WPARAM hContact, LPARAM) { if (!MirandaExiting()) - Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(GetContactProto(hContact), ID_STATUS_OFFLINE, hContact)); + Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(Proto_GetBaseAccountName(hContact), ID_STATUS_OFFLINE, hContact)); return 0; } @@ -183,7 +183,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) } else if (!strcmp(cws->szModule, "Protocol")) { if (!strcmp(cws->szSetting, "p")) { - pdnce->szProto = GetContactProto(hContact); + pdnce->szProto = Proto_GetBaseAccountName(hContact); char *szProto = (cws->value.type == DBVT_DELETED) ? nullptr : cws->value.pszVal; Clist_ChangeContactIcon(hContact, g_clistApi.pfnIconFromStatusMode(szProto, pdnce->getStatus(), hContact)); } -- cgit v1.2.3