1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

don't double-add events in Room.addEventsToTimeline

also, ignore notif events from initialSync as their time ordering is wrong
This commit is contained in:
Matthew Hodgson
2016-09-10 00:52:39 +01:00
parent 2c6409a67a
commit b69f6cf70a
3 changed files with 12 additions and 9 deletions

View File

@@ -1792,7 +1792,8 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
).then(function(res) {
var token = res.end;
var matrixEvents = utils.map(res.chunk, self.getEventMapper());
room.addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);
eventTimeline.getTimelineSet()
.addEventsToTimeline(matrixEvents, backwards, eventTimeline, token);
// if we've hit the end of the timeline, we need to stop trying to
// paginate. We need to keep the 'forwards' token though, to make sure