Only filter if a filter was provided

pull/6329/head
Brendan Abolivier 2019-11-05 15:27:38 +00:00
parent f141af4c79
commit cb2cbe4d26
No known key found for this signature in database
GPG Key ID: 1E015C145F1916CD
1 changed files with 6 additions and 4 deletions

View File

@ -875,10 +875,12 @@ class RoomContextHandler(object):
room_id, event_id, before_limit, after_limit, event_filter room_id, event_id, before_limit, after_limit, event_filter
) )
filtered_before_events = event_filter.filter(results["events_before"]) if event_filter:
results["events_before"] = yield filter_evts(filtered_before_events) results["events_before"] = event_filter.filter(results["events_before"])
filtered_after_events = event_filter.filter(results["events_after"]) results["events_after"] = event_filter.filter(results["events_after"])
results["events_after"] = yield filter_evts(filtered_after_events)
results["events_before"] = yield filter_evts(results["events_before"])
results["events_after"] = yield filter_evts(results["events_after"])
results["event"] = event results["event"] = event
if results["events_after"]: if results["events_after"]: