summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-30 13:55:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-30 13:55:32 +0000
commit5af8f1dae14233cb203d78da7b5b1a286272cc6a (patch)
tree2cc9e3bcc330229df4aa94805f50a0bf32e098b2 /plugins/Dbx_mdb/src
parent918af1e0ebe3c00f9b7ac15596931463bc74e54a (diff)
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
Diffstat (limited to 'plugins/Dbx_mdb/src')
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp
index d42975e698..5b99500e90 100644
--- a/plugins/Dbx_mdb/src/dbevents.cpp
+++ b/plugins/Dbx_mdb/src/dbevents.cpp
@@ -51,10 +51,13 @@ STDMETHODIMP_(MEVENT) CDbxMdb::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;
}