summary refs log tree commit diff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-09-06 01:41:04 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-09-06 01:41:23 +0200
commit80fa3e801f36566c8127c43ecdbbb9410b3bada2 (patch)
tree248fbaf4c212d4ad8e203fcabffee140828b117f /src/Cache.cpp
parentTranslated using Weblate (Portuguese (Portugal)) (diff)
downloadnheko-80fa3e801f36566c8127c43ecdbbb9410b3bada2.tar.xz
Fix duplicate check possibly leaving large gaps if initial state was not in timeline
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 5b43192c..d009c0d3 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -3005,7 +3005,7 @@ Cache::saveTimelineMessages(lmdb::txn &txn,
                         // is already in the DB, we skip putting it (again) in ordered DBs, and only
                         // update the event itself and its relations.
                         std::string_view unused_read;
-                        if (!eventsDb.get(txn, event_id, unused_read)) {
+                        if (!evToOrderDb.get(txn, event_id, unused_read)) {
                                 ++index;
 
                                 nhlog::db()->debug("saving '{}'", orderEntry.dump());
@@ -3090,7 +3090,7 @@ Cache::saveOldMessages(const std::string &room_id, const mtx::responses::Message
                 // already in the DB, we skip putting it (again) in ordered DBs, and only update the
                 // event itself and its relations.
                 std::string_view unused_read;
-                if (!eventsDb.get(txn, event_id, unused_read)) {
+                if (!evToOrderDb.get(txn, event_id, unused_read)) {
                         --index;
 
                         json orderEntry        = json::object();