1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py
index b3bd92d37c..a1770f620e 100644
--- a/synapse/state/__init__.py
+++ b/synapse/state/__init__.py
@@ -213,19 +213,23 @@ class StateHandler:
return ret.state
async def get_current_users_in_room(
- self, room_id: str, latest_event_ids: Optional[List[str]] = None
+ self, room_id: str, latest_event_ids: List[str]
) -> Dict[str, ProfileInfo]:
"""
Get the users who are currently in a room.
+ Note: This is much slower than using the equivalent method
+ `DataStore.get_users_in_room` or `DataStore.get_users_in_room_with_profiles`,
+ so this should only be used when wanting the users at a particular point
+ in the room.
+
Args:
room_id: The ID of the room.
latest_event_ids: Precomputed list of latest event IDs. Will be computed if None.
Returns:
Dictionary of user IDs to their profileinfo.
"""
- if not latest_event_ids:
- latest_event_ids = await self.store.get_latest_event_ids_in_room(room_id)
+
assert latest_event_ids is not None
logger.debug("calling resolve_state_groups from get_current_users_in_room")
|