summary refs log tree commit diff
path: root/src/TimelineView.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-13 19:58:48 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-13 19:58:48 +0300
commitc060a136a971cc3251b7766bb353bbe3b1d601e8 (patch)
tree6d580d7af59bdeef1037d83216fa71788422468c /src/TimelineView.cc
parentInitial support for backwards pagination (diff)
downloadnheko-c060a136a971cc3251b7766bb353bbe3b1d601e8.tar.xz
Update prev_batch only while paginating
Diffstat (limited to 'src/TimelineView.cc')
-rw-r--r--src/TimelineView.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/TimelineView.cc b/src/TimelineView.cc
index 9f80db66..aec519ed 100644
--- a/src/TimelineView.cc
+++ b/src/TimelineView.cc
@@ -219,7 +219,10 @@ int TimelineView::addEvents(const Timeline &timeline)
 {
 	int message_count = 0;
 
-	prev_batch_token_ = timeline.previousBatch();
+	if (isInitialSync) {
+		prev_batch_token_ = timeline.previousBatch();
+		isInitialSync = false;
+	}
 
 	for (const auto &event : timeline.events()) {
 		TimelineItem *item = parseMessageEvent(event.toObject(), TimelineDirection::Bottom);