From 7e2f835eeceb31232f5d0e46703fc52a32bbef7a Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 17 Feb 2018 19:29:53 +0200 Subject: [PATCH] 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 --- src/timeline/TimelineView.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }