From 23e2a8a4e4ef1e72bce629b99bc686d0804fd085 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 9 Apr 2018 21:13:51 +0300 Subject: fixes #1257 (database migration process must not filter out 'duplicate' events) --- plugins/Import/src/import.cpp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'plugins/Import/src') diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 7e61b493fb..fe266db89d 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -965,24 +965,27 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC nSkippedEvents++; } - if (!bSkipThis) { - // check for duplicate entries - if (!IsDuplicateEvent(hDst, dbei)) { - // no need to display all these dialogs again - if (dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_ADDED) - dbei.flags |= DBEF_READ; - - // add dbevent - MCONTACT hOwner = (bIsMeta) ? MapContact(srcDb->GetEventContact(hEvent)) : hDst; - if (hOwner != INVALID_CONTACT_ID) { - // add dbevent - if (dstDb->AddEvent(hOwner, &dbei) != NULL) - nMessagesCount++; - else - AddMessage(LPGENW("Failed to add message")); - } - } - else nDupes++; + if (bSkipThis) + continue; + + // check for duplicate entries + if (nImportOptions != IOPT_COMPLETE && IsDuplicateEvent(hDst, dbei)) { + nDupes++; + continue; + } + + // no need to display all these dialogs again + if (dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_ADDED) + dbei.flags |= DBEF_READ; + + // add dbevent + MCONTACT hOwner = (bIsMeta) ? MapContact(srcDb->GetEventContact(hEvent)) : hDst; + if (hOwner != INVALID_CONTACT_ID) { + // add dbevent + if (dstDb->AddEvent(hOwner, &dbei) != NULL) + nMessagesCount++; + else + AddMessage(LPGENW("Failed to add message")); } } -- cgit v1.2.3