You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
WIP refactor
This commit is contained in:
@@ -36,7 +36,6 @@ function EventTimeline(roomId) {
|
||||
this._startState.paginationToken = null;
|
||||
this._endState = new RoomState(roomId);
|
||||
this._endState.paginationToken = null;
|
||||
this._filter = null;
|
||||
|
||||
this._prevTimeline = null;
|
||||
this._nextTimeline = null;
|
||||
@@ -59,21 +58,6 @@ EventTimeline.BACKWARDS = "b";
|
||||
*/
|
||||
EventTimeline.FORWARDS = "f";
|
||||
|
||||
/**
|
||||
* Get the filter object this timeline is filtered on
|
||||
*/
|
||||
EventTimeline.prototype.getFilter = function() {
|
||||
return this._filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the filter object this timeline is filtered on
|
||||
* (passed to the server when paginating via /messages).
|
||||
*/
|
||||
EventTimeline.prototype.setFilter = function(filter) {
|
||||
this._filter = filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise the start and end state with the given events
|
||||
*
|
||||
@@ -233,14 +217,6 @@ EventTimeline.prototype.setNeighbouringTimeline = function(neighbour, direction)
|
||||
EventTimeline.prototype.addEvent = function(event, atStart) {
|
||||
var stateContext = atStart ? this._startState : this._endState;
|
||||
|
||||
// manually filter the event if we have a filter, as currently we insert
|
||||
// events incrementally only from the main /sync rather than a filtered
|
||||
// /sync to avoid running multiple redundant /syncs.
|
||||
if (this._filter) {
|
||||
var events = this._filter.filterRoomTimeline([event]);
|
||||
if (!events) return;
|
||||
}
|
||||
|
||||
setEventMetadata(event, stateContext, atStart);
|
||||
|
||||
// modify state
|
||||
|
||||
Reference in New Issue
Block a user