1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00
This commit is contained in:
Matthew Hodgson
2016-09-08 00:18:17 +01:00
parent dac820f957
commit fc495a5f1e
7 changed files with 125 additions and 42 deletions

View File

@@ -127,11 +127,16 @@ Filter.prototype.setDefinition = function(definition) {
);
// don't bother porting this from synapse yet:
// this._room_state_filter = new FilterComponent(room_filter_json.state || {});
// this._room_ephemeral_filter = new FilterComponent(room_filter_json.ephemeral || {});
// this._room_account_data_filter = new FilterComponent(room_filter_json.account_data || {});
// this._presence_filter = new FilterComponent(definition.presence || {});
// this._account_data_filter = new FilterComponent(definition.account_data || {});
// this._room_state_filter =
// new FilterComponent(room_filter_json.state || {});
// this._room_ephemeral_filter =
// new FilterComponent(room_filter_json.ephemeral || {});
// this._room_account_data_filter =
// new FilterComponent(room_filter_json.account_data || {});
// this._presence_filter =
// new FilterComponent(definition.presence || {});
// this._account_data_filter =
// new FilterComponent(definition.account_data || {});
};
/**
@@ -145,6 +150,8 @@ Filter.prototype.getRoomTimelineFilterComponent = function() {
/**
* Filter the list of events based on whether they are allowed in a timeline
* based on this filter
* @param {MatrixEvent[]} events the list of events being filtered
* @return {MatrixEvent[]} the list of events which match the filter
*/
Filter.prototype.filterRoomTimeline = function(events) {
return this._room_timeline_filter.filter(this._room_filter.filter(events));