From 6be9b9c1dd00da5ecd33cbc20ece4162ba56c402 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 19 Jul 2014 14:11:25 +0000 Subject: db_mc_tryMeta applied git-svn-id: http://svn.miranda-ng.org/main/trunk@9860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirandaG15/src/CAppletManager.cpp | 12 +----------- plugins/MirandaG15/src/CAppletManager.h | 2 -- plugins/MirandaG15/src/CContactList.cpp | 28 ++++++++++++++-------------- 3 files changed, 15 insertions(+), 27 deletions(-) (limited to 'plugins/MirandaG15') diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 4cdd3c4296..2ae86f175b 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -589,7 +589,7 @@ void CAppletManager::HandleEvent(CEvent *pEvent) } pEvent->bLog = pEvent->bNotification; - if(CAppletManager::IsSubContact(pEvent->hContact)) + if(db_mc_isSub(pEvent->hContact)) { pEvent->bLog = false; pEvent->bNotification = false; @@ -755,16 +755,6 @@ void CAppletManager::CancelMessageJob(SMessageJob *pJob) } } -//************************************************************************ -// returns wether or not a contact is a subcontact -//************************************************************************ -bool CAppletManager::IsSubContact(MCONTACT hContact) -{ - if(!db_get_b(0, "MetaContacts", "Enabled", 1)) - return false; - return db_mc_isSub(hContact) != 0; -} - //************************************************************************ // sends typing notifications to the specified contact //************************************************************************ diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h index 13efb58c5d..e95a063cb8 100644 --- a/plugins/MirandaG15/src/CAppletManager.h +++ b/plugins/MirandaG15/src/CAppletManager.h @@ -89,8 +89,6 @@ public: // returns a formatted timestamp string static tstring GetFormattedTimestamp(tm *time); - // returns wether or not a contact is a subcontact - static bool IsSubContact(MCONTACT hContact); // returns the contacts group static tstring GetContactGroup(MCONTACT hContact); // returns the contacts displayname diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 904090ddd8..3f951be342 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -81,7 +81,7 @@ CContactListEntry *CContactList::GetContactData(CListEntry *pItem = NULL; - if((!CAppletManager::IsSubContact(hContact) && !CConfig::GetBoolSetting(CLIST_USEGROUPS)) || strGroup.empty()) + if((!db_mc_isSub(hContact) && !CConfig::GetBoolSetting(CLIST_USEGROUPS)) || strGroup.empty()) { pItem = AddItem(psContact); ((CListContainer*)this)->sort(CContactList::CompareEntries); @@ -180,7 +180,7 @@ void CContactList::AddContact(MCONTACT hContact) } pItem = pGroup->AddItem(psContact); - if(!CAppletManager::IsSubContact(hContact) && iStatus != ID_STATUS_OFFLINE) + if(!db_mc_isSub(hContact) && iStatus != ID_STATUS_OFFLINE) ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,1); pGroup->sort(CContactList::CompareEntries); @@ -220,7 +220,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { if(db_get_b(pEntry->hHandle,"CList","Hidden",0)) return false; - if(CAppletManager::IsSubContact(pEntry->hHandle)) { + if(db_mc_isSub(pEntry->hHandle)) { MCONTACT hMetaContact = db_mc_getMeta(pEntry->hHandle); if(db_get_b(hMetaContact,"CList","Hidden",0)) return false; @@ -266,10 +266,10 @@ void CContactList::RemoveContact(MCONTACT hContact) { // Update the contacts group if it has one if(pGroup->GetType() != ROOT) { - if(!CAppletManager::IsSubContact(hContact) && pEntry->iStatus != ID_STATUS_OFFLINE) + if(!db_mc_isSub(hContact) && pEntry->iStatus != ID_STATUS_OFFLINE) ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,-1); - if(!CAppletManager::IsSubContact(hContact) && pEntry->iMessages > 0) + if(!db_mc_isSub(hContact) && pEntry->iMessages > 0) ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,0,-pEntry->iMessages); } @@ -739,10 +739,10 @@ void CContactList::OnStatusChange(MCONTACT hContact,int iStatus) CListContainer* pGroup = ((CListContainer*)pContactEntry->GetParent()); if(pGroup->GetType() != ROOT) { - if(!CAppletManager::IsSubContact(hContact) && iStatus == ID_STATUS_OFFLINE && iOldStatus != ID_STATUS_OFFLINE) + if(!db_mc_isSub(hContact) && iStatus == ID_STATUS_OFFLINE && iOldStatus != ID_STATUS_OFFLINE) ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,-1); - else if(!CAppletManager::IsSubContact(hContact) && iStatus != ID_STATUS_OFFLINE && iOldStatus == ID_STATUS_OFFLINE) + else if(!db_mc_isSub(hContact) && iStatus != ID_STATUS_OFFLINE && iOldStatus == ID_STATUS_OFFLINE) ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,1); } @@ -796,7 +796,7 @@ void CContactList::OnContactAdded(MCONTACT hContact) if(!pGroup) pGroup = CreateGroupObjectByPath(strGroup); - if(!CAppletManager::IsSubContact(hContact)) + if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(strGroup,1); } } @@ -817,7 +817,7 @@ void CContactList::OnContactDeleted(MCONTACT hContact) CContactListGroup *pGroup = GetGroupObjectByPath(strGroup); - if(!CAppletManager::IsSubContact(hContact)) + if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(strGroup,-1); if(pGroup->iMembers <= 0) @@ -851,7 +851,7 @@ void CContactList::OnContactGroupChanged(MCONTACT hContact,tstring strGroup) if(pContainer->GetType() != ROOT) { pOldGroup = pContainer->GetGroupData(); - if(!CAppletManager::IsSubContact(hContact)) + if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(pOldGroup->strPath,-1); } @@ -861,7 +861,7 @@ void CContactList::OnContactGroupChanged(MCONTACT hContact,tstring strGroup) CContactListGroup *pGroup = GetGroupObjectByPath(strGroup); if(!pGroup) pGroup = CreateGroupObjectByPath(strGroup); - if(!CAppletManager::IsSubContact(hContact)) + if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(strGroup,1); } @@ -1043,7 +1043,7 @@ void CContactList::InitializeGroupObjects() pGroup = CreateGroupObjectByPath(strGroup); // update it's counters - if(!CAppletManager::IsSubContact(hContact)) + if(!db_mc_isSub(hContact)) ChangeGroupObjectCounters(strGroup,1); } -- cgit v1.2.3