diff options
author | David Robertson <davidr@element.io> | 2021-11-17 14:19:27 +0000 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2021-11-17 14:19:27 +0000 |
commit | 077b74929f8f412395d1156e1b97eb16701059fa (patch) | |
tree | 25ecb8e93ec3ba275596bfb31efa45018645d47b /synapse/handlers/admin.py | |
parent | Correct target of link to the modules page from the Password Auth Providers p... (diff) | |
parent | 1.47.0 (diff) | |
download | synapse-077b74929f8f412395d1156e1b97eb16701059fa.tar.xz |
Merge remote-tracking branch 'origin/release-v1.47'
Diffstat (limited to 'synapse/handlers/admin.py')
-rw-r--r-- | synapse/handlers/admin.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/synapse/handlers/admin.py b/synapse/handlers/admin.py index a53cd62d3c..be3203ac80 100644 --- a/synapse/handlers/admin.py +++ b/synapse/handlers/admin.py @@ -90,6 +90,7 @@ class AdminHandler: Membership.LEAVE, Membership.BAN, Membership.INVITE, + Membership.KNOCK, ), ) @@ -122,6 +123,13 @@ class AdminHandler: invited_state = invite.unsigned["invite_room_state"] writer.write_invite(room_id, invite, invited_state) + if room.membership == Membership.KNOCK: + event_id = room.event_id + knock = await self.store.get_event(event_id, allow_none=True) + if knock: + knock_state = knock.unsigned["knock_room_state"] + writer.write_knock(room_id, knock, knock_state) + continue # We only want to bother fetching events up to the last time they @@ -239,6 +247,20 @@ class ExfiltrationWriter(metaclass=abc.ABCMeta): raise NotImplementedError() @abc.abstractmethod + def write_knock( + self, room_id: str, event: EventBase, state: StateMap[dict] + ) -> None: + """Write a knock for the room, with associated knock state. + + Args: + room_id: The room ID the knock is for. + event: The knock event. + state: A subset of the state at the knock, with a subset of the + event keys (type, state_key content and sender). + """ + raise NotImplementedError() + + @abc.abstractmethod def finished(self) -> Any: """Called when all data has successfully been exported and written. |