summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-05-02 20:18:40 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-05-02 20:18:40 +0300
commit2fe5168598a082a94a815c1cca0ffaacbd661581 (patch)
treeac3b974a6902be5f75c0af52a6fc6266103b035a
parent63a3fc37c9988835b397d234e7f1f6210d5fe284 (diff)
fixes #2367 (После удаления истории меты в базе остаются пустые события)
-rw-r--r--plugins/Dbx_mdbx/src/dbevents.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp
index b534706b25..e3d4dfe015 100644
--- a/plugins/Dbx_mdbx/src/dbevents.cpp
+++ b/plugins/Dbx_mdbx/src/dbevents.cpp
@@ -333,15 +333,9 @@ void CDbxMDBX::FindNextUnread(const txn_ptr &txn, DBCachedContact *cc, DBEventSo
bool CDbxMDBX::CheckEvent(DBCachedContact *cc, const DBEvent *cdbe, DBCachedContact *&cc2)
{
- // event's owner matches contactID passed? ok, nothing to care about
- if (cdbe->dwContactID == cc->contactID) {
- cc2 = nullptr;
- return true;
- }
-
- // if cc is a sub, cdbe should be its meta
+ // if cc is a sub, cdbe should contain its id
if (cc->IsSub()) {
- if (cc->parentID != cdbe->dwContactID)
+ if (cc->contactID != cdbe->dwContactID)
return false;
cc2 = m_cache->GetCachedContact(cc->parentID);
@@ -357,8 +351,9 @@ bool CDbxMDBX::CheckEvent(DBCachedContact *cc, const DBEvent *cdbe, DBCachedCont
return (cc2->parentID == cc->contactID);
}
- // the contactID is invalid
- return false;
+ // neither a sub, nor a meta. a usual contact. Contact IDs must match one another
+ cc2 = nullptr;
+ return cc->contactID == cdbe->dwContactID;
}
///////////////////////////////////////////////////////////////////////////////