diff options
author | Erik Johnston <erik@matrix.org> | 2017-11-08 16:13:27 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-11-08 16:13:27 +0000 |
commit | e8814410ef682a1e277a1cfe6fda7268fd7a33d6 (patch) | |
tree | 56020619a56a2483ff69427aff5e4f223c8d7ade /synapse/groups | |
parent | Revert "Modify group room association API to allow modification of is_public" (diff) | |
download | synapse-e8814410ef682a1e277a1cfe6fda7268fd7a33d6.tar.xz |
Have an explicit API to update room config
Diffstat (limited to 'synapse/groups')
-rw-r--r-- | synapse/groups/groups_server.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py index 81f21a36f5..a8039f4788 100644 --- a/synapse/groups/groups_server.py +++ b/synapse/groups/groups_server.py @@ -546,6 +546,29 @@ class GroupsServerHandler(object): defer.returnValue({}) @defer.inlineCallbacks + def update_room_in_group(self, group_id, requester_user_id, room_id, config_key, + content): + """Update room in group + """ + RoomID.from_string(room_id) # Ensure valid room id + + yield self.check_group_is_ours( + group_id, requester_user_id, and_exists=True, and_is_admin=requester_user_id + ) + + if config_key == "visibility": + is_public = _parse_visibility_from_contents(content) + + yield self.store.update_room_in_group_visibility( + group_id, room_id, + is_public=is_public, + ) + else: + raise SynapseError(400, "Uknown config option") + + defer.returnValue({}) + + @defer.inlineCallbacks def remove_room_from_group(self, group_id, requester_user_id, room_id): """Remove room from group """ |