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/CmdLine/src/mimcmd_handlers.cpp | 6 +++--- plugins/CmdLine/src/utils.cpp | 4 ++-- plugins/CmdLine/src/utils.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/CmdLine/src') diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 4aeaa16d74..74bfa10f37 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1167,7 +1167,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS; for (auto &hContact : Contacts()) { - GetContactProto(hContact, protocol, _countof(protocol)); + Proto_GetBaseAccountName(hContact, protocol, _countof(protocol)); ptrW contact(GetContactName(hContact, protocol)); ptrW id(GetContactID(hContact, protocol)); @@ -1197,7 +1197,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS; *reply->message = 0; for (auto &hContact : Contacts()) { - GetContactProto(hContact, protocol, _countof(protocol)); + Proto_GetBaseAccountName(hContact, protocol, _countof(protocol)); ptrW contact(GetContactName(hContact, protocol)); ptrW id(GetContactID(hContact, protocol)); @@ -1276,7 +1276,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re } char protocol[128]; - GetContactProto(hContact, protocol, _countof(protocol)); + Proto_GetBaseAccountName(hContact, protocol, _countof(protocol)); ptrW contact(GetContactName(hContact, protocol)); mir_snwprintf(buffer, TranslateT("%s:%S - %d unread events."), contact, protocol, count); diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index e877aa6477..86da417721 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -140,7 +140,7 @@ wchar_t* GetContactName(MCONTACT hContact, char *szProto) return Contact_GetInfo(CNF_DISPLAY, hContact, szProto); } -void GetContactProto(MCONTACT hContact, char *szProto, size_t size) +void Proto_GetBaseAccountName(MCONTACT hContact, char *szProto, size_t size) { GetStringFromDatabase(hContact, "Protocol", "p", nullptr, szProto, size); } @@ -157,7 +157,7 @@ MCONTACT GetContactFromID(wchar_t *szID, char *szProto) int found = 0; for (auto &hContact : Contacts()) { - GetContactProto(hContact, cProtocol, sizeof(cProtocol)); + Proto_GetBaseAccountName(hContact, cProtocol, sizeof(cProtocol)); ptrW szHandle(GetContactID(hContact, cProtocol)); wchar_t *tmp = Clist_GetContactDisplayName(hContact); diff --git a/plugins/CmdLine/src/utils.h b/plugins/CmdLine/src/utils.h index 617f329391..f87c8e6a97 100644 --- a/plugins/CmdLine/src/utils.h +++ b/plugins/CmdLine/src/utils.h @@ -46,7 +46,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, wchar_t* GetContactName(MCONTACT hContact, char *szProto); wchar_t* GetContactID(MCONTACT hContact, char *szProto); MCONTACT GetContactFromID(wchar_t *szID, char *szProto); -void GetContactProto(MCONTACT hContact, char *szProto, size_t size); +void Proto_GetBaseAccountName(MCONTACT hContact, char *szProto, size_t size); int MyPUShowMessage(char *lpzText, BYTE kind); -- cgit v1.2.3