summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp
index 30078625c7..d8ea2607a2 100644
--- a/plugins/Dbx_mdb/src/dbevents.cpp
+++ b/plugins/Dbx_mdb/src/dbevents.cpp
@@ -252,7 +252,9 @@ void CDbxMdb::FindNextUnread(const txn_ptr &txn, DBCachedContact *cc, DBEventSor
mdb_cursor_get(cursor, &key, &data, MDB_SET);
while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) {
DBEvent *dbe = (DBEvent*)data.mv_data;
- if (dbe->contactID == cc->contactID && !dbe->markedRead()) {
+ if (dbe->contactID != cc->contactID)
+ break;
+ if (!dbe->markedRead()) {
cc->dbc.dwFirstUnread = key2.dwEventId;
cc->dbc.tsFirstUnread = key2.ts;
return;