From 4797b9fa9651c2bb5a35ca67497c2f0eb4956820 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 23 Oct 2020 19:42:12 +0200 Subject: Fix infinite pagination properly now. --- src/timeline/EventStore.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/timeline/EventStore.cpp') diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index 22809a20..38292f49 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -54,8 +54,11 @@ EventStore::EventStore(std::string room_id, QObject *) &EventStore::oldMessagesRetrieved, this, [this](const mtx::responses::Messages &res) { - if (cache::client()->previousBatchToken(room_id_) == res.end) + if (cache::client()->previousBatchToken(room_id_) == res.end) { noMoreMessages = true; + emit fetchedMore(); + return; + } uint64_t newFirst = cache::client()->saveOldMessages(room_id_, res); if (newFirst == first) -- cgit 1.5.1