summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-09-26 16:05:46 +0100
committerGitHub <noreply@github.com>2017-09-26 16:05:46 +0100
commit1e5fcfd14a892cdcc7f836bb022073e383599a0d (patch)
tree889b3b1cbfc30181fe7c9e67e122d3c0f1cc5d03 /synapse/rest
parentMerge pull request #2471 from matrix-org/erikj/group_summary_publicised (diff)
parentAdd remove room API (diff)
downloadsynapse-1e5fcfd14a892cdcc7f836bb022073e383599a0d.tar.xz
Merge pull request #2472 from matrix-org/erikj/groups_rooms
Add remove room from group API
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v2_alpha/groups.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/groups.py b/synapse/rest/client/v2_alpha/groups.py
index b469058e9d..8f3ce15b02 100644
--- a/synapse/rest/client/v2_alpha/groups.py
+++ b/synapse/rest/client/v2_alpha/groups.py
@@ -423,6 +423,17 @@ class GroupAdminRoomsServlet(RestServlet):
 
         defer.returnValue((200, result))
 
+    @defer.inlineCallbacks
+    def on_DELETE(self, request, group_id, room_id):
+        requester = yield self.auth.get_user_by_req(request)
+        user_id = requester.user.to_string()
+
+        result = yield self.groups_handler.remove_room_from_group(
+            group_id, user_id, room_id,
+        )
+
+        defer.returnValue((200, result))
+
 
 class GroupAdminUsersInviteServlet(RestServlet):
     """Invite a user to the group