From b3844451f92050910276e34a6bd89fe24331bf1d Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Thu, 8 Aug 2019 11:47:02 +0100 Subject: Introduce `get_room_state`; a way to get state for a single room Signed-off-by: Olivier Wilkinson (reivilibre) --- synapse/storage/stats.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'synapse') 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): """ -- cgit 1.5.1