diff options
author | Erik Johnston <erik@matrix.org> | 2017-06-19 12:36:28 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-06-19 12:37:27 +0100 |
commit | d7fe6b356c5b74ffc5681f85a0d6100f4b4f2295 (patch) | |
tree | d5695155a2dc3779be156bef18445a102660c6e3 /synapse/storage/directory.py | |
parent | add missing boolean to synapse_port_db (diff) | |
download | synapse-d7fe6b356c5b74ffc5681f85a0d6100f4b4f2295.tar.xz |
Add shutdown room API
Diffstat (limited to 'synapse/storage/directory.py')
-rw-r--r-- | synapse/storage/directory.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/directory.py b/synapse/storage/directory.py index 9caaf81f2c..79e7c540ad 100644 --- a/synapse/storage/directory.py +++ b/synapse/storage/directory.py @@ -170,3 +170,17 @@ class DirectoryStore(SQLBaseStore): "room_alias", desc="get_aliases_for_room", ) + + def update_aliases_for_room(self, old_room_id, new_room_id, creator): + def _update_aliases_for_room_txn(txn): + sql = "UPDATE room_aliases SET room_id = ?, creator = ? WHERE room_id = ?" + txn.execute(sql, (new_room_id, creator, old_room_id,)) + self._invalidate_cache_and_stream( + txn, self.get_aliases_for_room, (old_room_id,) + ) + self._invalidate_cache_and_stream( + txn, self.get_aliases_for_room, (new_room_id,) + ) + return self.runInteraction( + "_update_aliases_for_room_txn", _update_aliases_for_room_txn + ) |