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
This commit is contained in:
Konstantinos Sideris 2018-02-17 19:29:53 +02:00
parent fdd5051dcf
commit 7e2f835eec

View file

@ -153,7 +153,8 @@ TimelineView::addBackwardsEvents(const QString &room_id, const mtx::responses::M
if (room_id_ != room_id) if (room_id_ != room_id)
return; 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; isTimelineFinished = true;
return; return;
} }