summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-11-06 18:14:03 +0000
committerBrendan Abolivier <babolivier@matrix.org>2019-11-06 18:14:03 +0000
commiteda14737cf0faf789ec587633b12bb2cf65fa305 (patch)
tree72b92b5a47670b5234a6a7fbfaf9448f3ca34e00 /synapse/handlers/room.py
parentOnly filter if a filter was provided (diff)
downloadsynapse-eda14737cf0faf789ec587633b12bb2cf65fa305.tar.xz
Also filter state events
Diffstat (limited to '')
-rw-r--r--synapse/handlers/room.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index f47237b3fb..3148df0de9 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -907,7 +907,13 @@ class RoomContextHandler(object):
         state = yield self.state_store.get_state_for_events(
             [last_event_id], state_filter=state_filter
         )
-        results["state"] = list(state[last_event_id].values())
+
+        # 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)
 
         # We use a dummy token here as we only care about the room portion of
         # the token, which we replace.