diff options
author | reivilibre <oliverw@matrix.org> | 2022-08-16 12:16:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 13:16:56 +0100 |
commit | c3516e9decc355b75a297d72a13b98a43d312e66 (patch) | |
tree | 54511640eeda393cc0d8725f151f350aafe6639c /synapse/storage/controllers/state.py | |
parent | Make push rules use proper structures. (#13522) (diff) | |
download | synapse-c3516e9decc355b75a297d72a13b98a43d312e66.tar.xz |
Faster room joins: make `/joined_members` block whilst the room is partial stated. (#13514)
Diffstat (limited to 'synapse/storage/controllers/state.py')
-rw-r--r-- | synapse/storage/controllers/state.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/controllers/state.py b/synapse/storage/controllers/state.py index 0d480f1014..0c78eb735e 100644 --- a/synapse/storage/controllers/state.py +++ b/synapse/storage/controllers/state.py @@ -30,6 +30,7 @@ from typing import ( from synapse.api.constants import EventTypes from synapse.events import EventBase from synapse.logging.opentracing import trace +from synapse.storage.roommember import ProfileInfo from synapse.storage.state import StateFilter from synapse.storage.util.partial_state_events_tracker import ( PartialCurrentStateTracker, @@ -506,3 +507,15 @@ class StateStorageController: await self._partial_state_room_tracker.await_full_state(room_id) return await self.stores.main.get_current_hosts_in_room(room_id) + + async def get_users_in_room_with_profiles( + self, room_id: str + ) -> Dict[str, ProfileInfo]: + """ + Get the current users in the room with their profiles. + If the room is currently partial-stated, this will block until the room has + full state. + """ + await self._partial_state_room_tracker.await_full_state(room_id) + + return await self.stores.main.get_users_in_room_with_profiles(room_id) |