Make pagination logic slightly more robust

This commit is contained in:
Nicolas Werner 2021-04-29 10:23:50 +02:00
parent 32962a5616
commit dbf23fafbf
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -61,7 +61,7 @@ EventStore::EventStore(std::string room_id, QObject *)
&EventStore::oldMessagesRetrieved, &EventStore::oldMessagesRetrieved,
this, this,
[this](const mtx::responses::Messages &res) { [this](const mtx::responses::Messages &res) {
if (cache::client()->previousBatchToken(room_id_) == res.end) { if (res.end.empty() || cache::client()->previousBatchToken(room_id_) == res.end) {
noMoreMessages = true; noMoreMessages = true;
emit fetchedMore(); emit fetchedMore();
return; return;