Introduce get_room_state; a way to get state for a single room

Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
This commit is contained in:
Olivier Wilkinson (reivilibre) 2019-08-08 11:47:02 +01:00
parent 4a3fec1f3b
commit b3844451f9

View file

@ -748,6 +748,20 @@ class StatsStore(StateDeltasStore):
"room_state", None, retcols=("name", "topic", "canonical_alias") "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() @cached()
def get_earliest_token_for_stats(self, stats_type, id): def get_earliest_token_for_stats(self, stats_type, id):
""" """