Try to fix issue of pagination interfering with limited: true

pull/251/head
Nicolas Werner 4 years ago
parent 7eb0c4e09c
commit b972d827cb
  1. 6
      src/timeline/EventStore.cpp

@ -529,6 +529,12 @@ EventStore::fetchMore()
http::client()->messages( http::client()->messages(
opts, [this, opts](const mtx::responses::Messages &res, mtx::http::RequestErr err) { opts, [this, opts](const mtx::responses::Messages &res, mtx::http::RequestErr err) {
if (cache::client()->previousBatchToken(room_id_) != opts.from) {
nhlog::net()->warn("Cache cleared while fetching more messages, dropping "
"/messages response");
emit fetchedMore();
return;
}
if (err) { if (err) {
nhlog::net()->error("failed to call /messages ({}): {} - {} - {}", nhlog::net()->error("failed to call /messages ({}): {} - {} - {}",
opts.room_id, opts.room_id,

Loading…
Cancel
Save