From d608950bea1cecb4a36b2ca3a07790a94139aa63 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Fri, 31 Aug 2018 09:57:04 +0300 Subject: [PATCH] Stop calling /messages if the prev_batch token is empty --- src/timeline/TimelineView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeline/TimelineView.cpp b/src/timeline/TimelineView.cpp index e994409a..6eb553e8 100644 --- a/src/timeline/TimelineView.cpp +++ b/src/timeline/TimelineView.cpp @@ -168,7 +168,7 @@ void TimelineView::addBackwardsEvents(const mtx::responses::Messages &msgs) { // We've reached the start of the timline and there're no more messages. - if ((msgs.end == msgs.start) && msgs.chunk.size() == 0) { + if (msgs.end.empty() || ((msgs.end == msgs.start) && msgs.chunk.size() == 0)) { isTimelineFinished = true; return; }