summary refs log tree commit diff
path: root/src/timeline/EventStore.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-10-20 13:46:05 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-10-20 13:46:05 +0200
commitaa9b453f8109b70c9e65fd21f2f3fcce0e73b544 (patch)
tree131a734336f4a6db96b1b13bebbec69e0ca5b7ef /src/timeline/EventStore.cpp
parentHide room name, if not loaded yet (diff)
downloadnheko-aa9b453f8109b70c9e65fd21f2f3fcce0e73b544.tar.xz
Store timestamp with olm sessions
Diffstat (limited to 'src/timeline/EventStore.cpp')
-rw-r--r--src/timeline/EventStore.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp

index d3c5c3fa..3564ffc0 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp
@@ -54,6 +54,9 @@ EventStore::EventStore(std::string room_id, QObject *) &EventStore::oldMessagesRetrieved, this, [this](const mtx::responses::Messages &res) { + if (cache::client()->previousBatchToken(room_id_) == res.end) + noMoreMessages = true; + uint64_t newFirst = cache::client()->saveOldMessages(room_id_, res); if (newFirst == first) fetchMore(); @@ -687,6 +690,9 @@ EventStore::get(std::string_view id, std::string_view related_to, bool decrypt) void EventStore::fetchMore() { + if (noMoreMessages) + return; + mtx::http::MessagesOpts opts; opts.room_id = room_id_; opts.from = cache::client()->previousBatchToken(room_id_);