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
fix filtering
This commit is contained in:
@@ -464,11 +464,8 @@ Room.prototype.getOrCreateFilteredTimelineSet = function(filter) {
|
||||
if (this._filteredTimelineSets[filter.filterId]) {
|
||||
return this._filteredTimelineSets[filter.filterId];
|
||||
}
|
||||
var timelineSet = new EventTimelineSet(
|
||||
this.roomId, this, {
|
||||
filter: filter,
|
||||
}
|
||||
);
|
||||
var opts = Object.assign({ filter: filter }, this._opts);
|
||||
var timelineSet = new EventTimelineSet(this.roomId, this, opts);
|
||||
reEmit(this, timelineSet, [ "Room.timeline" ]);
|
||||
this._filteredTimelineSets[filter.filterId] = timelineSet;
|
||||
this._timelineSets.push(timelineSet);
|
||||
@@ -607,7 +604,15 @@ Room.prototype.addPendingEvent = function(event, txnId) {
|
||||
this._pendingEventList.push(event);
|
||||
} else {
|
||||
for (var i = 0; i < this._timelineSets.length; i++) {
|
||||
this._timelineSets[i].addEventToTimeline(event, this._timelineSets[i].getLiveTimeline(), false);
|
||||
var timelineSet = this._timelineSets[i];
|
||||
if (timelineSet.getFilter()) {
|
||||
if (this._filter.filterRoomTimeline([event]).length) {
|
||||
timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
timelineSet.addEventToTimeline(event, timelineSet.getLiveTimeline(), false);
|
||||
}
|
||||
}
|
||||
// notifications are receive-only, so we don't need to worry about this._notifTimelineSet.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user