summary refs log tree commit diff
path: root/synapse/module_api
diff options
context:
space:
mode:
authorMatt C <96466754+buffless-matt@users.noreply.github.com>2022-08-05 19:37:58 +1000
committerGitHub <noreply@github.com>2022-08-05 09:37:58 +0000
commit026ac4486cca13d12200667ed8237e22c37edf12 (patch)
tree548afc65d556eb48fd7bb8e0eb4e546ba8b0813e /synapse/module_api
parentAdd comments about how event push actions are stored. (#13445) (diff)
downloadsynapse-026ac4486cca13d12200667ed8237e22c37edf12.tar.xz
Update module API "update room membership" method to allow for remote joins (#13441)
Co-authored-by: MattC <buffless-matt@users.noreply.github.com>
Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
Diffstat (limited to 'synapse/module_api')
-rw-r--r--synapse/module_api/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py
index 71145870ee..87ba154cb7 100644
--- a/synapse/module_api/__init__.py
+++ b/synapse/module_api/__init__.py
@@ -929,10 +929,12 @@ class ModuleApi:
         room_id: str,
         new_membership: str,
         content: Optional[JsonDict] = None,
+        remote_room_hosts: Optional[List[str]] = None,
     ) -> EventBase:
         """Updates the membership of a user to the given value.
 
         Added in Synapse v1.46.0.
+        Changed in Synapse v1.65.0: Added the 'remote_room_hosts' parameter.
 
         Args:
             sender: The user performing the membership change. Must be a user local to
@@ -946,6 +948,7 @@ class ModuleApi:
                 https://spec.matrix.org/unstable/client-server-api/#mroommember for the
                 list of allowed values.
             content: Additional values to include in the resulting event's content.
+            remote_room_hosts: Remote servers to use for remote joins/knocks/etc.
 
         Returns:
             The newly created membership event.
@@ -1005,15 +1008,12 @@ class ModuleApi:
             room_id=room_id,
             action=new_membership,
             content=content,
+            remote_room_hosts=remote_room_hosts,
         )
 
         # Try to retrieve the resulting event.
         event = await self._hs.get_datastores().main.get_event(event_id)
 
-        # update_membership is supposed to always return after the event has been
-        # successfully persisted.
-        assert event is not None
-
         return event
 
     async def create_and_send_event_into_room(self, event_dict: JsonDict) -> EventBase: