From 4613ce7f80f2a5d7cebad04bfcdbf01f26980679 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Mar 2014 18:03:06 +0000 Subject: more correct default sub assignment git-svn-id: http://svn.miranda-ng.org/main/trunk@8515 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbevents.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'plugins/Db3x_mmap') diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 704e91f78e..393d6b69e0 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -25,15 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static HANDLE hEventDeletedEvent, hEventAddedEvent, hEventFilterAddedEvent; -static int IndexOf(DBCachedContact *cc, MCONTACT hSub) -{ - for (int i = 0; i < cc->nSubs; i++) - if (cc->pSubs[i] == hSub) - return i; - - return -1; -} - STDMETHODIMP_(LONG) CDb3Mmap::GetEventCount(MCONTACT contactID) { mir_cslock lck(m_csDbAccess); @@ -61,11 +52,9 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) return NULL; if (cc->IsSub()) { - if (cc = m_cache->GetCachedContact(cc->parentID)) { - // set default sub to the event's source - cc->nDefault = IndexOf(cc, contactID); - contactID = cc->contactID; // and add an event to a metahistory - } + // set default sub to the event's source + CallService(MS_MC_SETDEFAULTCONTACT, cc->parentID, contactID); + contactID = cc->parentID; // and add an event to a metahistory } } -- cgit v1.2.3