summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
commit3bb16e798cb51d5764aacbefd4edf26f52d8c4f0 (patch)
tree59dbb53fc9496d660ec2ef2846a4eab0f1720b88 /plugins/ContactsPlus
parent3216d8df5cb355f34c82ed10b7e40bab7525b697 (diff)
GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName
Diffstat (limited to 'plugins/ContactsPlus')
-rw-r--r--plugins/ContactsPlus/src/main.cpp4
-rw-r--r--plugins/ContactsPlus/src/receive.cpp6
-rw-r--r--plugins/ContactsPlus/src/send.cpp8
-rw-r--r--plugins/ContactsPlus/src/utils.cpp6
4 files changed, 12 insertions, 12 deletions
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp
index 6a2c053891..1b759ce240 100644
--- a/plugins/ContactsPlus/src/main.cpp
+++ b/plugins/ContactsPlus/src/main.cpp
@@ -110,7 +110,7 @@ static bool CheckContactsServiceSupport(const char* szProto)
static int HookPreBuildContactMenu(WPARAM hContact, LPARAM)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
bool bVisible = false;
if (szProto && CheckContactsServiceSupport(szProto)) {
@@ -149,7 +149,7 @@ static int HookModulesLoaded(WPARAM, LPARAM)
static int HookContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto))
return 0;
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 144f91ce41..2a6144c5b3 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -139,7 +139,7 @@ static void RebuildGroupCombo(HWND hwndDlg)
static MCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
{
wchar_t *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
- char *szProto = GetContactProto(wndData->mhContact);
+ char *szProto = Proto_GetBaseAccountName(wndData->mhContact);
wndData->rhSearch = (HANDLE)CallProtoService(szProto, PS_BASICSEARCH, 0, (LPARAM)caUIN); // find it
replaceStrW(wndData->haUin, caUIN);
for (int j = 0; j < wndData->cbReceived; j++)
@@ -181,7 +181,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
TranslateMenu(wndData->mhPopup);
wndData->hHook = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
- char *szProto =GetContactProto(wndData->mhContact);
+ char *szProto =Proto_GetBaseAccountName(wndData->mhContact);
HWND hLV = GetDlgItem(hwndDlg, IDC_CONTACTS);
ListView_SetExtendedListViewStyle(hLV, LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT);
@@ -314,7 +314,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
wchar_t *caUIN = ListView_GetItemTextEx(hLV, i, 0);
for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
if (!mir_wstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
- char *szProto =GetContactProto(wndData->mhContact);
+ char *szProto =Proto_GetBaseAccountName(wndData->mhContact);
hContact = (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
if (hContact && caGroup)
Clist_ContactChangeGroup(hContact, nGroupId);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp
index 71e44df0b2..c082aca4b7 100644
--- a/plugins/ContactsPlus/src/send.cpp
+++ b/plugins/ContactsPlus/src/send.cpp
@@ -133,7 +133,7 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, MCONTACT *phContacts, in
int TSendContactsData::SendContacts(HWND hwndDlg)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
int nMaxContacts = CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXCONTACTSPERPACKET, hContact);
if (!nMaxContacts) {
@@ -196,7 +196,7 @@ static void SetAllContactChecks(HWND hwndList, MCONTACT hReceiver) // doubtful n
return;
binListEvent = TRUE;
- char *szProto = GetContactProto(hReceiver);
+ char *szProto = Proto_GetBaseAccountName(hReceiver);
if (szProto == nullptr)
return;
@@ -207,7 +207,7 @@ static void SetAllContactChecks(HWND hwndList, MCONTACT hReceiver) // doubtful n
MCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem);
while (hContact) {
- char* szProto2 = GetContactProto(hContact);
+ char* szProto2 = Proto_GetBaseAccountName(hContact);
// different protocols or protocol undefined, remove contact, useless anyway
if (strcmpnull(szProto, szProto2))
@@ -399,7 +399,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(ackData->hContact);
+ dbei.szModule = Proto_GetBaseAccountName(ackData->hContact);
dbei.eventType = EVENTTYPE_CONTACTS;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.timestamp = time(0);
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index 4656317da4..f5563456be 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -57,7 +57,7 @@ char* __fastcall null_strdup(const char *string)
wchar_t* GetContactUID(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
const char *uid = Proto_GetUniqueId(szProto);
if (uid == nullptr)
return nullptr;
@@ -109,7 +109,7 @@ void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, wchar_t *pszTitleStart)
mir_wstrncpy(newtitle, TranslateW(pszTitleStart), _countof(newtitle));
if (hContact) {
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto) {
ptrW uid(GetContactUID(hContact));
wchar_t *contactName = Clist_GetContactDisplayName(hContact);
@@ -150,7 +150,7 @@ HICON InitMButton(HWND hDlg, int idButton, int idIcon, wchar_t *szTip)
HICON LoadContactProtoIcon(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto)
return (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
return nullptr;