diff options
author | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-08 11:47:02 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-08-08 11:47:02 +0100 |
commit | b3844451f92050910276e34a6bd89fe24331bf1d (patch) | |
tree | d880970b0f0c1ba1447355d671d5006eed7afbac | |
parent | Fix tests (diff) | |
download | synapse-b3844451f92050910276e34a6bd89fe24331bf1d.tar.xz |
Introduce `get_room_state`; a way to get state for a single room
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r-- | synapse/storage/stats.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py index 755faaaaa2..63f0fc5314 100644 --- a/synapse/storage/stats.py +++ b/synapse/storage/stats.py @@ -748,6 +748,20 @@ class StatsStore(StateDeltasStore): "room_state", None, retcols=("name", "topic", "canonical_alias") ) + def get_room_state(self, room_id): + return self._simple_select_one( + "room_state", + {"room_id": room_id}, + retcols=( + "name", + "topic", + "canonical_alias", + "avatar", + "join_rules", + "history_visibility", + ), + ) + @cached() def get_earliest_token_for_stats(self, stats_type, id): """ |