diff options
author | George Hazan <ghazan@miranda.im> | 2019-12-04 16:08:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-12-04 16:08:03 +0300 |
commit | 3bb16e798cb51d5764aacbefd4edf26f52d8c4f0 (patch) | |
tree | 59dbb53fc9496d660ec2ef2846a4eab0f1720b88 /plugins/MirandaG15 | |
parent | 3216d8df5cb355f34c82ed10b7e40bab7525b697 (diff) |
GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName
Diffstat (limited to 'plugins/MirandaG15')
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 16 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CChatScreen.cpp | 6 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CContactList.cpp | 6 | ||||
-rw-r--r-- | plugins/MirandaG15/src/CEventScreen.cpp | 2 |
4 files changed, 15 insertions, 15 deletions
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 0f6ea0cb75..24d0c75abe 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -551,7 +551,7 @@ void CAppletManager::HandleEvent(CEvent *pEvent) // check for protocol filters if (pEvent->hContact != NULL && pEvent->eType != EVENT_CONTACT_ADDED) { - char *szProto = GetContactProto(pEvent->hContact); + char *szProto = Proto_GetBaseAccountName(pEvent->hContact); if (szProto == nullptr || !CConfig::GetProtocolNotificationFilter(toTstring(szProto))) pEvent->bNotification = false; } @@ -639,7 +639,7 @@ void CAppletManager::FinishMessageJob(SMessageJob *pJob) list<SMessageJob*>::iterator iter = m_MessageJobs.begin(); while (iter != m_MessageJobs.end()) { if ((*iter) == pJob) { - char *szProto = GetContactProto(pJob->hContact); + char *szProto = Proto_GetBaseAccountName(pJob->hContact); tstring strProto = toTstring(szProto); CIRCConnection *pIRCCon = GetIRCConnection(strProto); @@ -703,7 +703,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact, bool bEnable) if (!db_get_b(hContact, "SRMsg", "SupportTyping", db_get_b(0, "SRMsg", "DefaultTyping", 1))) return; - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (!szProto) return; @@ -733,7 +733,7 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag { tstring strAscii = _A2T(toNarrowString(strMessage).c_str()); - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); tstring strProto = toTstring(szProto); CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(strProto); @@ -883,7 +883,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hd } if (CConfig::GetBoolSetting(NOTIFY_SHOWPROTO)) { - char *szProto = GetContactProto(pEvent->hContact); + char *szProto = Proto_GetBaseAccountName(pEvent->hContact); pEvent->strDescription = L"(" + toTstring(szProto) + L") " + pEvent->strDescription; } @@ -1015,7 +1015,7 @@ void CAppletManager::DeleteIRCHistory(MCONTACT hContact) //************************************************************************ CIRCHistory *CAppletManager::CreateIRCHistory(MCONTACT hContact, tstring strChannel) { - char *szProto = GetContactProto(hContact); + char *szProto = Proto_GetBaseAccountName(hContact); if (!szProto) return nullptr; @@ -1401,7 +1401,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) int iOldStatus = CAppletManager::GetInstance()->m_ContactlistScreen.GetContactStatus(Event.hContact); - char *szProto = GetContactProto(Event.hContact); + char *szProto = Proto_GetBaseAccountName(Event.hContact); tstring strProto = toTstring(szProto); CProtocolData *pProtocolData = CAppletManager::GetInstance()->GetProtocolData(toTstring(szProto)); @@ -1634,7 +1634,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) Event.strValue = toTstring(dbcws->value.pszVal); } else { - char *szProto = GetContactProto(Event.hContact); + char *szProto = Proto_GetBaseAccountName(Event.hContact); if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; Event.strValue = dbv.pwszVal; diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index 580d5aa024..d735218093 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -162,7 +162,7 @@ void CChatScreen::UpdateObjects() void CChatScreen::UpdateLabels()
{
tstring strNickname = CAppletManager::GetContactDisplayname(m_hContact);
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
m_iStatus = ID_STATUS_OFFLINE;
tstring strProto = L"";
@@ -213,7 +213,7 @@ bool CChatScreen::SetContact(MCONTACT hContact) }
// Check if the contact is valid
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
m_strProto = toTstring(szProto);
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(m_strProto);
@@ -249,7 +249,7 @@ void CChatScreen::LoadHistory() if (!m_hContact)
return;
- char *szProto = GetContactProto(m_hContact);
+ char *szProto = Proto_GetBaseAccountName(m_hContact);
if (m_bIRCProtocol && db_get_b(m_hContact, szProto, "ChatRoom", 0) != 0) {
if (!CAppletManager::GetInstance()->IsIRCHookEnabled()) {
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index e50c5d57f8..06592a2ce5 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -92,7 +92,7 @@ void CContactList::AddContact(MCONTACT hContact) CListContainer<CContactListEntry*, CContactListGroup*> *pGroup = nullptr;
tstring strName = CAppletManager::GetContactDisplayname(hContact);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
tstring strGroup = GetContactGroupPath(hContact);
// ignore contacts without a valid protocoll
@@ -191,7 +191,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) int dwNumContacts = db_mc_getSubCount(pEntry->hHandle);
for (int i = 0; i < dwNumContacts; i++) {
MCONTACT hSubContact = db_mc_getSub(pEntry->hHandle, i);
- char *szProto = GetContactProto(hSubContact);
+ char *szProto = Proto_GetBaseAccountName(hSubContact);
if (db_get_w(hSubContact, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
return true;
}
@@ -937,7 +937,7 @@ void CContactList::InitializeGroupObjects() for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
tstring strGroup = GetContactGroupPath(hContact);
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (szProto && db_get_b(0, META_PROTO, "Enabled", 1) && !mir_strcmpi(szProto, META_PROTO)) {
tstring strName = CAppletManager::GetContactDisplayname(hContact);
tstring strPath = L"";
diff --git a/plugins/MirandaG15/src/CEventScreen.cpp b/plugins/MirandaG15/src/CEventScreen.cpp index 324f508369..a298db306c 100644 --- a/plugins/MirandaG15/src/CEventScreen.cpp +++ b/plugins/MirandaG15/src/CEventScreen.cpp @@ -183,7 +183,7 @@ void CEventScreen::OnLCDButtonDown(int iButton) return;
// if the contact is an irc chatroom, check if it is hidden (user left the channel)
- char *szProto = GetContactProto(pEntry->hContact);
+ char *szProto = Proto_GetBaseAccountName(pEntry->hContact);
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(szProto));
if (pIRCCon && db_get_b(pEntry->hContact, szProto, "ChatRoom", 0) != 0 && Contact_IsHidden(pEntry->hContact))
|