Skip to content

Commit b35c648

Browse files
Skip processing policy server events through policy server (#18605)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
1 parent bfb3a6e commit b35c648

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

changelog.d/18605.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure policy servers are not asked to scan policy server change events, allowing rooms to disable the use of a policy server while the policy server is down.

synapse/handlers/room_policy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ async def is_event_allowed(self, event: EventBase) -> bool:
5454
Returns:
5555
bool: True if the event is allowed in the room, False otherwise.
5656
"""
57+
if event.type == "org.matrix.msc4284.policy" and event.state_key is not None:
58+
return True # always allow policy server change events
59+
5760
policy_event = await self._storage_controllers.state.get_current_state_event(
5861
event.room_id, "org.matrix.msc4284.policy", ""
5962
)

0 commit comments

Comments
 (0)