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/NewXstatusNotify/src/indsnd.cpp | 4 ++-- plugins/NewXstatusNotify/src/main.cpp | 14 +++++++------- plugins/NewXstatusNotify/src/popup.cpp | 4 ++-- plugins/NewXstatusNotify/src/xstatus.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/NewXstatusNotify/src') diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index ba3d8cedc7..3c196a4d4e 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); { hContact = lParam; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); ListView_SetImageList(hList, GetStatusIconsImgList(szProto), LVSIL_SMALL); ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); @@ -304,7 +304,7 @@ void SetAllContactsIcons(HWND hwndList) for (auto &hContact : Contacts()) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0); if (hItem) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { EnableSounds = g_plugin.getByte(hContact, "EnableSounds", 1); EnablePopups = g_plugin.getByte(hContact, "EnablePopups", 1); diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index ab6f591208..0da90707e8 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -79,7 +79,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_USERON BYTE GetGender(MCONTACT hContact) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { switch (db_get_b(hContact, szProto, "Gender", 0)) { case 'M': @@ -374,12 +374,12 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) } bool bEnablePopup = true, bEnableSound = true; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); int myStatus = Proto_GetStatus(szProto); if (!mir_strcmp(szProto, META_PROTO)) { //this contact is Meta MCONTACT hSubContact = db_mc_getMostOnline(hContact); - char *szSubProto = GetContactProto(hSubContact); + char *szSubProto = Proto_GetBaseAccountName(hSubContact); if (szSubProto == nullptr) return 0; @@ -475,7 +475,7 @@ int ProcessStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (newStatus < ID_STATUS_MIN || newStatus > ID_STATUS_MAX) return 0; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (mir_strcmp(cws->szModule, szProto)) return 0; @@ -518,7 +518,7 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) { XSTATUSCHANGE *xsc; STATUSMSGINFO smi = { 0 }; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); smi.hContact = hContact; if (strstr(cws->szSetting, "/mood/") || strstr(cws->szSetting, "/activity/")) { // Jabber mood or activity changed @@ -616,7 +616,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) { STATUSMSGINFO smi; bool bEnablePopup = true, bEnableSound = true; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); smi.proto = szProto; smi.hContact = hContact; @@ -778,7 +778,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact == NULL) return 0; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto == nullptr) return 0; diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index f34743fc1e..08cb6dfd39 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -96,7 +96,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) void QueryAwayMessage(HWND hWnd, PLUGINDATA *pdp) { MCONTACT hContact = PUGetContact(hWnd); - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(pdp->newStatus))) @@ -186,7 +186,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case UM_INITPOPUP: pdp = (PLUGINDATA *)PUGetPluginData(hwnd); if (pdp != nullptr) { - char *szProto = GetContactProto(PUGetContact(hwnd)); + char *szProto = Proto_GetBaseAccountName(PUGetContact(hwnd)); if (szProto && opt.ReadAwayMsg && StatusHasAwayMessage(szProto, pdp->newStatus)) { int myStatus = Proto_GetStatus(szProto); if (myStatus != ID_STATUS_INVISIBLE) diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 0f13da626e..931f938336 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -470,7 +470,7 @@ void AddXStatusEventThread(void *arg) { MCONTACT hContact = (MCONTACT)(DWORD_PTR)arg; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto == nullptr) return; @@ -503,7 +503,7 @@ void AddSMsgEventThread(void *arg) STATUSMSGINFO smi; smi.hContact = hContact; - smi.proto = GetContactProto(hContact); + smi.proto = Proto_GetBaseAccountName(hContact); if (smi.proto == nullptr) return; -- cgit v1.2.3