diff options
author | David Baker <dave@matrix.org> | 2017-11-01 16:20:19 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-11-01 16:20:19 +0000 |
commit | 4f0488b3070b53596bba78a6446ff09a1c50ca16 (patch) | |
tree | 0eeb49822a2f016e77a54ec77643b33dde0a301b /synapse/storage/group_server.py | |
parent | Move access token deletion into auth handler (diff) | |
parent | Merge pull request #2615 from matrix-org/rav/break_auth_device_dep (diff) | |
download | synapse-4f0488b3070b53596bba78a6446ff09a1c50ca16.tar.xz |
Merge remote-tracking branch 'origin/develop' into rav/refactor_accesstoken_delete
Diffstat (limited to 'synapse/storage/group_server.py')
-rw-r--r-- | synapse/storage/group_server.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/synapse/storage/group_server.py b/synapse/storage/group_server.py index 8c4ad0a9a9..f6924e1a32 100644 --- a/synapse/storage/group_server.py +++ b/synapse/storage/group_server.py @@ -846,19 +846,25 @@ class GroupServerStore(SQLBaseStore): ) return self.runInteraction("remove_user_from_group", _remove_user_from_group_txn) - def add_room_to_group(self, group_id, room_id, is_public): - return self._simple_insert( + def update_room_group_association(self, group_id, room_id, is_public): + return self._simple_upsert( table="group_rooms", - values={ + keyvalues={ "group_id": group_id, "room_id": room_id, + }, + values={ "is_public": is_public, }, - desc="add_room_to_group", + insertion_values={ + "group_id": group_id, + "room_id": room_id, + }, + desc="update_room_group_association", ) - def remove_room_from_group(self, group_id, room_id): - def _remove_room_from_group_txn(txn): + def delete_room_group_association(self, group_id, room_id): + def _delete_room_group_association_txn(txn): self._simple_delete_txn( txn, table="group_rooms", @@ -877,7 +883,7 @@ class GroupServerStore(SQLBaseStore): }, ) return self.runInteraction( - "remove_room_from_group", _remove_room_from_group_txn, + "delete_room_group_association", _delete_room_group_association_txn, ) def get_publicised_groups_for_user(self, user_id): |