summary refs log tree commit diff
path: root/synapse/federation/transport/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-07-20 09:46:33 +0100
committerErik Johnston <erik@matrix.org>2017-07-20 09:46:33 +0100
commit6f443a74cf6ab0bfe452289f9888580725987765 (patch)
treec993649ca55493d35e9be821b2768dbee30531df /synapse/federation/transport/server.py
parentComments (diff)
downloadsynapse-6f443a74cf6ab0bfe452289f9888580725987765.tar.xz
Add update group profile API
Diffstat (limited to 'synapse/federation/transport/server.py')
-rw-r--r--synapse/federation/transport/server.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py
index 1332b49f35..e04750fd2a 100644
--- a/synapse/federation/transport/server.py
+++ b/synapse/federation/transport/server.py
@@ -642,6 +642,18 @@ class FederationGroupsSummaryServlet(BaseFederationServlet):
 
         defer.returnValue((200, new_content))
 
+    @defer.inlineCallbacks
+    def on_POST(self, origin, content, query, group_id):
+        requester_user_id = parse_string_from_args(query, "requester_user_id")
+        if get_domain_from_id(requester_user_id) != origin:
+            raise SynapseError(403, "requester_user_id doesn't match origin")
+
+        new_content = yield self.handler.update_group_profile(
+            group_id, requester_user_id, content
+        )
+
+        defer.returnValue((200, new_content))
+
 
 class FederationGroupsRoomsServlet(BaseFederationServlet):
     """Get the rooms in a group on behalf of a user