summary refs log tree commit diff
path: root/synapse/replication/http/membership.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-11-29 13:30:36 +0000
committerGitHub <noreply@github.com>2019-11-29 13:30:36 +0000
commit1c3a61529fa898808ea9cb424bc1587dffdc7353 (patch)
treee33af67e215bd374ec02cc62744b44174b39aeaa /synapse/replication/http/membership.py
parentMerge pull request #6436 from matrix-org/babolivier/fix-state-retrieval (diff)
parentNewsfile (diff)
downloadsynapse-1c3a61529fa898808ea9cb424bc1587dffdc7353.tar.xz
Merge pull request #6434 from matrix-org/erikj/msc2367_membership_reasons
Implement MSC 2367 - Membership Reasons
Diffstat (limited to 'synapse/replication/http/membership.py')
-rw-r--r--synapse/replication/http/membership.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/replication/http/membership.py b/synapse/replication/http/membership.py
index cc1f249740..3577611fd7 100644
--- a/synapse/replication/http/membership.py
+++ b/synapse/replication/http/membership.py
@@ -93,6 +93,7 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
         {
             "requester": ...,
             "remote_room_hosts": [...],
+            "content": { ... }
         }
     """
 
@@ -107,7 +108,7 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
         self.clock = hs.get_clock()
 
     @staticmethod
-    def _serialize_payload(requester, room_id, user_id, remote_room_hosts):
+    def _serialize_payload(requester, room_id, user_id, remote_room_hosts, content):
         """
         Args:
             requester(Requester)
@@ -118,12 +119,14 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
         return {
             "requester": requester.serialize(),
             "remote_room_hosts": remote_room_hosts,
+            "content": content,
         }
 
     async def _handle_request(self, request, room_id, user_id):
         content = parse_json_object_from_request(request)
 
         remote_room_hosts = content["remote_room_hosts"]
+        event_content = content["content"]
 
         requester = Requester.deserialize(self.store, content["requester"])
 
@@ -134,7 +137,7 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
 
         try:
             event = await self.federation_handler.do_remotely_reject_invite(
-                remote_room_hosts, room_id, user_id
+                remote_room_hosts, room_id, user_id, event_content,
             )
             ret = event.get_pdu_json()
         except Exception as e: