Incorporate review

This commit is contained in:
Brendan Abolivier 2019-12-04 14:18:46 +00:00
parent b2f8c21a9b
commit 08a436ecb2
No known key found for this signature in database
GPG Key ID: 1E015C145F1916CD
3 changed files with 2 additions and 3 deletions

1
changelog.d/6329.bugfix Normal file
View File

@ -0,0 +1 @@
Correctly apply the event filter to the `state`, `events_before` and `events_after` fields in the response to `/context` requests.

View File

@ -1 +0,0 @@
Filter `state`, `events_before` and `events_after` in `/context` requests.

View File

@ -908,12 +908,11 @@ class RoomContextHandler(object):
[last_event_id], state_filter=state_filter
)
# Apply the filter on state events.
state_events = list(state[last_event_id].values())
if event_filter:
state_events = event_filter.filter(state_events)
results["state"] = list(state_events)
results["state"] = state_events
# We use a dummy token here as we only care about the room portion of
# the token, which we replace.