summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-17 19:29:53 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-17 19:29:53 +0200
commit7e2f835eeceb31232f5d0e46703fc52a32bbef7a (patch)
tree6b8c4dacd059eda9d4c2d6501a12947da3454fc4
parentRemove QPropertyAnimation from modals to work around a regression on Qt 5.10.... (diff)
downloadnheko-7e2f835eeceb31232f5d0e46703fc52a32bbef7a.tar.xz
Properly detect the start of the timeline
We can't rely solely on the number of the returned messages
because it could be zero if all the event types are unknown.

fixes #168
-rw-r--r--src/timeline/TimelineView.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc

index 063b9f9d..8d1c8ae1 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc
@@ -153,7 +153,8 @@ TimelineView::addBackwardsEvents(const QString &room_id, const mtx::responses::M if (room_id_ != room_id) return; - if (msgs.chunk.size() == 0) { + // We've reached the start of the timline and there're no more messages. + if ((msgs.end == msgs.start) && msgs.chunk.size() == 0) { isTimelineFinished = true; return; }