mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Disable optimistic pagination to fetch events edited into the thread before the threadroot
fixes #1661
This commit is contained in:
parent
51236c3260
commit
8ca0f61cad
1 changed files with 10 additions and 1 deletions
|
@ -123,7 +123,16 @@ TimelineFilter::fetchAgain()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (auto s = source(); s && incrementalSearchIndex == std::numeric_limits<int>::max()) {
|
if (auto s = source(); s && incrementalSearchIndex == std::numeric_limits<int>::max()) {
|
||||||
if (this->rowCount() == cachedCount && s->canFetchMore(QModelIndex()))
|
if (this->rowCount() == cachedCount && s->canFetchMore(QModelIndex()) &&
|
||||||
|
// If we already have the event id of the thread in the timeline and we are filtering by
|
||||||
|
// thread, we can stop fetching more messages In theory an event could have been edited
|
||||||
|
// earlier in the timeline into the thread. So in theory this check is insufficient and
|
||||||
|
// we should instead verify that all events referring to this thread are in the timeline
|
||||||
|
// instead of just the thread root, but only Nheko supports that atm and the check would
|
||||||
|
// be expensive.
|
||||||
|
// TODO(Nico): check that all thread referrencing events are in the timeline by also
|
||||||
|
// checking all edits inside the thread.
|
||||||
|
(threadId.isEmpty() || s->idToIndex(threadId) == -1))
|
||||||
s->fetchMore(QModelIndex());
|
s->fetchMore(QModelIndex());
|
||||||
else
|
else
|
||||||
cachedCount = this->rowCount();
|
cachedCount = this->rowCount();
|
||||||
|
|
Loading…
Reference in a new issue