diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-11-05 15:27:38 +0000 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-11-05 15:28:36 +0000 |
commit | cb2cbe4d26b5d0c082c82a62260c0c05afde8aeb (patch) | |
tree | d319874bc6ff28848ef5f850d253f69e87b9f26e | |
parent | Update copyright (diff) | |
download | synapse-cb2cbe4d26b5d0c082c82a62260c0c05afde8aeb.tar.xz |
Only filter if a filter was provided
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/room.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index f6e162484c..f47237b3fb 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -875,10 +875,12 @@ class RoomContextHandler(object): room_id, event_id, before_limit, after_limit, event_filter ) - filtered_before_events = event_filter.filter(results["events_before"]) - results["events_before"] = yield filter_evts(filtered_before_events) - filtered_after_events = event_filter.filter(results["events_after"]) - results["events_after"] = yield filter_evts(filtered_after_events) + if event_filter: + results["events_before"] = event_filter.filter(results["events_before"]) + results["events_after"] = event_filter.filter(results["events_after"]) + + results["events_before"] = yield filter_evts(results["events_before"]) + results["events_after"] = yield filter_evts(results["events_after"]) results["event"] = event if results["events_after"]: |