From 5af8f1dae14233cb203d78da7b5b1a286272cc6a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 30 Mar 2015 13:55:32 +0000 Subject: fix for the wrong number of events after import git-svn-id: http://svn.miranda-ng.org/main/trunk@12550 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_kv/src/dbevents.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/Dbx_kv/src') diff --git a/plugins/Dbx_kv/src/dbevents.cpp b/plugins/Dbx_kv/src/dbevents.cpp index 72a0f239e7..2d292d1de9 100644 --- a/plugins/Dbx_kv/src/dbevents.cpp +++ b/plugins/Dbx_kv/src/dbevents.cpp @@ -51,10 +51,13 @@ STDMETHODIMP_(MEVENT) CDbxKV::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) if (cc->IsSub()) { ccSub = cc; + if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL) + return 0; + // set default sub to the event's source if (!(dbei->flags & DBEF_SENT)) - db_mc_setDefault(cc->parentID, contactID, false); - contactID = cc->parentID; // and add an event to a metahistory + db_mc_setDefault(cc->contactID, contactID, false); + contactID = cc->contactID; // and add an event to a metahistory if (db_mc_isEnabled()) contactNotifyID = contactID; } -- cgit v1.2.3