diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-04-03 14:32:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 14:32:20 +0100 |
commit | 4a4d5c4fd6552037a8660b18360ac7e0050b873f (patch) | |
tree | f0c4256ae44418064721a27c9d403acbbdfd70f2 /synapse/state/__init__.py | |
parent | Rewrite KeyringTestCase as a HomeServerTestCase (#4986) (diff) | |
download | synapse-4a4d5c4fd6552037a8660b18360ac7e0050b873f.tar.xz |
Fix grammar and document get_current_users_in_room (#4998)
Diffstat (limited to 'synapse/state/__init__.py')
-rw-r--r-- | synapse/state/__init__.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py index 52347fee34..36684ef9f6 100644 --- a/synapse/state/__init__.py +++ b/synapse/state/__init__.py @@ -161,10 +161,21 @@ class StateHandler(object): defer.returnValue(state) @defer.inlineCallbacks - def get_current_user_in_room(self, room_id, latest_event_ids=None): + def get_current_users_in_room(self, room_id, latest_event_ids=None): + """ + Get the users who are currently in a room. + + Args: + room_id (str): The ID of the room. + latest_event_ids (List[str]|None): Precomputed list of latest + event IDs. Will be computed if None. + Returns: + Deferred[Dict[str,ProfileInfo]]: Dictionary of user IDs to their + profileinfo. + """ if not latest_event_ids: latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id) - logger.debug("calling resolve_state_groups from get_current_user_in_room") + logger.debug("calling resolve_state_groups from get_current_users_in_room") entry = yield self.resolve_state_groups_for_events(room_id, latest_event_ids) joined_users = yield self.store.get_joined_users_from_state(room_id, entry) defer.returnValue(joined_users) |