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/Msg_Export/src/options.cpp | 8 ++++---- plugins/Msg_Export/src/utils.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/Msg_Export/src') diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index cec37e9e5f..531e26f690 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -79,11 +79,11 @@ int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) return mir_wstrcmpi(Clist_GetContactDisplayName(lParam1), Clist_GetContactDisplayName(lParam2)); if (lParamSort == 2) - return mir_strcmp(GetContactProto((MCONTACT)lParam1), GetContactProto((MCONTACT)lParam2)); + return mir_strcmp(Proto_GetBaseAccountName((MCONTACT)lParam1), Proto_GetBaseAccountName((MCONTACT)lParam2)); if (lParamSort == 3) { - DWORD dwUin1 = db_get_dw((MCONTACT)lParam1, GetContactProto((MCONTACT)lParam1), "UIN", 0); - DWORD dwUin2 = db_get_dw((MCONTACT)lParam2, GetContactProto((MCONTACT)lParam2), "UIN", 0); + DWORD dwUin1 = db_get_dw((MCONTACT)lParam1, Proto_GetBaseAccountName((MCONTACT)lParam1), "UIN", 0); + DWORD dwUin2 = db_get_dw((MCONTACT)lParam2, Proto_GetBaseAccountName((MCONTACT)lParam2), "UIN", 0); if (dwUin1 == dwUin2) return 0; return (dwUin1 > dwUin2) ? -1 : 1; @@ -473,7 +473,7 @@ public: wstring sTmp; LVITEM sItem = { 0 }; for (auto &hContact : Contacts()) { - PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); + PROTOACCOUNT *pa = Proto_GetAccount(Proto_GetBaseAccountName(hContact)); if (pa == nullptr) continue; diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 9dbba8f4e9..d9e3cc9307 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -457,7 +457,7 @@ void ReplaceDefines(MCONTACT hContact, wstring & sTarget) bool bIdentifierUsed = sTarget.find(L"%identifier%") != string::npos; if (bUINUsed || bEMailUsed || bProtoUsed || bIdentifierUsed) { - const char *szProto = GetContactProto(hContact); + const char *szProto = Proto_GetBaseAccountName(hContact); if (bUINUsed || (bIdentifierUsed && !mir_strcmp(szProto, "ICQ"))) { DWORD dwUIN = db_get_dw(hContact, szProto, "UIN", 0); wstring sReplaceUin; @@ -665,7 +665,7 @@ static bool ExportDBEventInfo(MCONTACT hContact, HANDLE hFile, wstring sFilePath wchar_t szTemp[500]; bool bWriteUTF8Format = false; - const char *szProto = GetContactProto(hContact); + const char *szProto = Proto_GetBaseAccountName(hContact); if (szProto == nullptr) { Netlib_Logf(0, MODULENAME ": cannot write message for a contact %d without protocol", hContact); return false; @@ -949,7 +949,7 @@ bool bIsExportEnabled(MCONTACT hContact) if (!g_plugin.getByte(hContact, "EnableLog", 1)) return false; - const char *szProto = GetContactProto(hContact); + const char *szProto = Proto_GetBaseAccountName(hContact); char szTemp[500]; mir_snprintf(szTemp, "DisableProt_%s", szProto); if (!g_plugin.getByte(szTemp, 1)) @@ -1130,6 +1130,6 @@ int nContactDeleted(WPARAM hContact, LPARAM) wchar_t* GetMyOwnNick(MCONTACT hContact) { - wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(hContact)); + wchar_t *p = Contact_GetInfo(CNF_DISPLAY, NULL, Proto_GetBaseAccountName(hContact)); return (p != nullptr) ? p : mir_wstrdup(TranslateT("No_Nick")); } -- cgit v1.2.3