diff options
author | Luke Barnard <lukebarnard1@users.noreply.github.com> | 2017-11-01 11:08:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 11:08:36 +0000 |
commit | 99354b430e224f8e949a3667fcd1ed75c92a060a (patch) | |
tree | e30b5ffb903071029757c08b1409ea1971619b1c /synapse/groups/groups_server.py | |
parent | Merge pull request #2610 from matrix-org/rav/schema_for_pw_providers (diff) | |
parent | Leave `is_public` as required argument of update_room_group_association (diff) | |
download | synapse-99354b430e224f8e949a3667fcd1ed75c92a060a.tar.xz |
Merge pull request #2612 from matrix-org/luke/groups-room-relationship-is-public
Modify group room association API to allow modification of is_public
Diffstat (limited to 'synapse/groups/groups_server.py')
-rw-r--r-- | synapse/groups/groups_server.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py index dedc9cc7fd..e21ac8e49e 100644 --- a/synapse/groups/groups_server.py +++ b/synapse/groups/groups_server.py @@ -531,8 +531,9 @@ class GroupsServerHandler(object): }) @defer.inlineCallbacks - def add_room_to_group(self, group_id, requester_user_id, room_id, content): - """Add room to group + def update_room_group_association(self, group_id, requester_user_id, room_id, + content): + """Add or update an association between room and group """ RoomID.from_string(room_id) # Ensure valid room id @@ -542,19 +543,21 @@ class GroupsServerHandler(object): is_public = _parse_visibility_from_contents(content) - yield self.store.add_room_to_group(group_id, room_id, is_public=is_public) + yield self.store.update_room_group_association( + group_id, room_id, is_public=is_public + ) defer.returnValue({}) @defer.inlineCallbacks - def remove_room_from_group(self, group_id, requester_user_id, room_id): + def delete_room_group_association(self, group_id, requester_user_id, room_id): """Remove room from group """ yield self.check_group_is_ours( group_id, requester_user_id, and_exists=True, and_is_admin=requester_user_id ) - yield self.store.remove_room_from_group(group_id, room_id) + yield self.store.delete_room_group_association(group_id, room_id) defer.returnValue({}) |