Stop calling /messages if the prev_batch token is empty

This commit is contained in:
Konstantinos Sideris 2018-08-31 09:57:04 +03:00
parent e29fceaee4
commit d608950bea

View file

@ -168,7 +168,7 @@ void
TimelineView::addBackwardsEvents(const mtx::responses::Messages &msgs) TimelineView::addBackwardsEvents(const mtx::responses::Messages &msgs)
{ {
// We've reached the start of the timline and there're no more messages. // 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; isTimelineFinished = true;
return; return;
} }