From 27b3f5f6b1fc544fad043bd8623c38c973e826a8 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 8 Sep 2016 03:02:26 +0100 Subject: [PATCH] create a global notif timeline set for each client --- src/MatrixClientPeg.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 190181c875..3ba50769a1 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -18,6 +18,8 @@ limitations under the License. import Matrix from 'matrix-js-sdk'; import utils from 'matrix-js-sdk/lib/utils'; +import EventTimeline from 'matrix-js-sdk/lib/models/event-timeline'; +import EventTimelineSet from 'matrix-js-sdk/lib/models/event-timeline-set'; const localStorage = window.localStorage; @@ -104,6 +106,13 @@ class MatrixClientPeg { this.matrixClient.setMaxListeners(500); this.matrixClient.setGuest(Boolean(creds.guest)); + + var notifTimelineSet = new EventTimelineSet(null, null, { + timelineSupport: true + }); + // XXX: what is our initial pagination token?! it somehow needs to be synchronised with /sync. + notifTimelineSet.getLiveTimeline().setPaginationToken("", EventTimeline.BACKWARDS); + this.matrixClient.setNotifTimelineSet(notifTimelineSet); } }