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

make EventTimeline take an EventTimelineSet

This commit is contained in:
Matthew Hodgson
2016-09-07 21:17:06 +01:00
parent 9b507f6c6c
commit 91f8df8d19
4 changed files with 20 additions and 11 deletions

View File

@@ -25,16 +25,17 @@ var MatrixEvent = require("./event").MatrixEvent;
* <p>Once a timeline joins up with its neighbour, they are linked together into a
* doubly-linked list.
*
* @param {string} roomId the ID of the room where this timeline came from
* @param {EventTimelineSet} eventTimelineSet the set of timelines this is part of
* @constructor
*/
function EventTimeline(roomId) {
this._roomId = roomId;
function EventTimeline(eventTimelineSet) {
this._eventTimelineSet = eventTimelineSet;
this._roomId = eventTimelineSet.roomId;
this._events = [];
this._baseIndex = 0;
this._startState = new RoomState(roomId);
this._startState = new RoomState(this._roomId);
this._startState.paginationToken = null;
this._endState = new RoomState(roomId);
this._endState = new RoomState(this._roomId);
this._endState.paginationToken = null;
this._prevTimeline = null;
@@ -43,7 +44,7 @@ function EventTimeline(roomId) {
// this is used by client.js
this._paginationRequests = {'b': null, 'f': null};
this._name = roomId + ":" + new Date().toISOString();
this._name = this._roomId + ":" + new Date().toISOString();
}
/**
@@ -91,6 +92,14 @@ EventTimeline.prototype.getRoomId = function() {
return this._roomId;
};
/**
* Get the filter for this timeline's timelineSet (if any)
* @return {Filter}} filter
*/
EventTimeline.prototype.getFilter = function() {
return this._eventTimelineSet.getFilter();
};
/**
* Get the base index.
*