diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-08-07 13:12:45 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-08-07 13:12:45 +0200 |
commit | b972d827cb1d3c35e8c561d1245204bd6f4b21f9 (patch) | |
tree | 1ca0ec6c6dda784b152bb8bfe134fa283b4b00b9 | |
parent | Also request keys from own devices (diff) | |
download | nheko-b972d827cb1d3c35e8c561d1245204bd6f4b21f9.tar.xz |
Try to fix issue of pagination interfering with limited: true
-rw-r--r-- | src/timeline/EventStore.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index 0e4c8b05..a983fe01 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -529,6 +529,12 @@ EventStore::fetchMore() http::client()->messages( 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) { nhlog::net()->error("failed to call /messages ({}): {} - {} - {}", opts.room_id, |