summary refs log tree commit diff
path: root/synapse/groups/groups_server.py
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/groups/groups_server.py
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/groups/groups_server.py')
-rw-r--r--synapse/groups/groups_server.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py
index 94cf9788bb..10bf61d178 100644
--- a/synapse/groups/groups_server.py
+++ b/synapse/groups/groups_server.py
@@ -466,8 +466,6 @@ class GroupsServerHandler(object):
             group_id, and_exists=True, and_is_admin=requester_user_id
         )
 
-        # TODO: Check if room has already been added
-
         is_public = _parse_visibility_from_contents(content)
 
         yield self.store.add_room_to_group(group_id, room_id, is_public=is_public)
@@ -475,6 +473,18 @@ class GroupsServerHandler(object):
         defer.returnValue({})
 
     @defer.inlineCallbacks
+    def remove_room_from_group(self, group_id, requester_user_id, room_id):
+        """Remove room from group
+        """
+        yield self.check_group_is_ours(
+            group_id, and_exists=True, and_is_admin=requester_user_id
+        )
+
+        yield self.store.remove_room_from_group(group_id, room_id)
+
+        defer.returnValue({})
+
+    @defer.inlineCallbacks
     def invite_to_group(self, group_id, user_id, requester_user_id, content):
         """Invite user to group
         """