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 --- src/core/stdmsg/src/cmdlist.cpp | 2 +- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stdmsg/src/msgs.cpp | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index cfcbea5a25..e30690a6a1 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -91,7 +91,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, LPARAM lParam) DBEVENTINFO dbei = {}; dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_SENT | DBEF_UTF | (p->flags & PREF_RTL ? DBEF_RTL : 0); - dbei.szModule = GetContactProto(hContact); + dbei.szModule = Proto_GetBaseAccountName(hContact); dbei.timestamp = time(0); dbei.cbBlob = (DWORD)(mir_strlen(p->szMsg) + 1); dbei.pBlob = (PBYTE)p->szMsg; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 7081150531..e54214668e 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -120,7 +120,7 @@ bool CMsgDialog::OnInitDialog() { CSuper::OnInitDialog(); - m_szProto = GetContactProto(m_hContact); + m_szProto = Proto_GetBaseAccountName(m_hContact); m_bIsMeta = db_mc_isMeta(m_hContact) != 0; m_hTimeZone = TimeZone_CreateByContact(m_hContact, nullptr, TZF_KNOWNONLY); m_wMinute = 61; diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index bb21d6c782..7158001cdf 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -527,7 +527,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) smre.hwndRichEditControl = m_rtf.GetHwnd(); MCONTACT hContact = db_mc_getSrmmSub(m_pDlg.m_hContact); - smre.Protocolname = (hContact != 0) ? GetContactProto(hContact) : m_pDlg.m_szProto; + smre.Protocolname = (hContact != 0) ? Proto_GetBaseAccountName(hContact) : m_pDlg.m_szProto; if (fi.chrg.cpMin > 0) { sel.cpMin = fi.chrg.cpMin; diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 20f8982253..97831b3066 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -94,7 +94,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) /* new message */ Skin_PlaySound("AlertMsg"); - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) { GetContainer()->AddPage(hContact); return 0; @@ -117,7 +117,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) INT_PTR SendMessageCmd(MCONTACT hContact, wchar_t *pwszInitialText) { /* does the MCONTACT's protocol support IM messages? */ - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (!szProto || !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) return 1; @@ -213,7 +213,7 @@ static int MessageSettingChanged(WPARAM hContact, LPARAM lParam) if (cws->szSetting && !strcmp(cws->szSetting, "Timezone")) Srmm_Broadcast(DM_NEWTIMEZONE, (WPARAM)cws, 0); else { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && !strcmp(cws->szModule, szProto)) Srmm_Broadcast(DM_UPDATETITLE, (WPARAM)cws, hContact); } @@ -263,7 +263,7 @@ static void RestoreUnreadMessageAlerts(void) if (windowAlreadyExists) continue; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) autoPopup = true; @@ -483,7 +483,7 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM) { if (hContact) { bool bEnabled = false; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (szProto) { // leave this menu item hidden for chats if (!db_get_b(hContact, szProto, "ChatRoom", 0)) -- cgit v1.2.3