Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Check third party rules before persisting knocks over federation #10212

Merged
merged 2 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10212.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement "room knocking" as per [MSC2403](https://github.com/matrix-org/matrix-doc/pull/2403). Contributed by Sorunome and anoa.
4 changes: 2 additions & 2 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2086,8 +2086,6 @@ async def on_send_knock_request(

context = await self.state_handler.compute_event_context(event)

await self._auth_and_persist_event(origin, event, context)

event_allowed = await self.third_party_event_rules.check_event_allowed(
event, context
)
Expand All @@ -2097,6 +2095,8 @@ async def on_send_knock_request(
403, "This event is not allowed in this context", Codes.FORBIDDEN
)

await self._auth_and_persist_event(origin, event, context)

return context

async def get_state_for_pdu(self, room_id: str, event_id: str) -> List[EventBase]:
Expand Down