Fix possible pagination issue when a sync returns an empty limited timeline

This commit is contained in:
Nicolas Werner 2024-04-24 00:39:00 +02:00
parent f465a5b52f
commit 821390c7d6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -1162,12 +1162,12 @@ TimelineModel::syncState(const mtx::responses::State &s)
void void
TimelineModel::addEvents(const mtx::responses::Timeline &timeline) TimelineModel::addEvents(const mtx::responses::Timeline &timeline)
{ {
if (timeline.events.empty())
return;
if (timeline.limited) if (timeline.limited)
setPaginationInProgress(false); setPaginationInProgress(false);
if (timeline.events.empty())
return;
events.handleSync(timeline); events.handleSync(timeline);
using namespace mtx::events; using namespace mtx::events;