Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fixup names and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Oct 3, 2019
1 parent d89ebf7 commit a9610cd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions synapse/storage/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def _get_joined_users_from_context(
missing_member_event_ids.append(event_id)

if missing_member_event_ids:
event_to_memberships = yield self._get_membership_from_event_ids(
event_to_memberships = yield self._get_joined_profiles_from_event_ids(
missing_member_event_ids
)
users_in_room.update((row for row in event_to_memberships.values() if row))
Expand All @@ -584,23 +584,24 @@ def _get_joined_users_from_context(
return users_in_room

@cached(max_entries=10000)
def _get_membership_from_event_id(self, event_id):
def _get_joined_profile_from_event_id(self, event_id):
raise NotADirectoryError()

@cachedList(
cached_method_name="_get_membership_from_event_id",
cached_method_name="_get_joined_profile_from_event_id",
list_name="event_ids",
inlineCallbacks=True,
)
def _get_membership_from_event_ids(self, event_ids):
"""Lookup profile info for set of member event IDs.
def _get_joined_profiles_from_event_ids(self, event_ids):
"""For given set of member event_ids check if they point to a join
event and if so return the associated user and profile info.
Args:
event_ids (Iterable[str]): The member event IDs to lookup
Returns:
Deferred[dict[str, Tuple[str, ProfileInfo]|None]]: Map from event ID
to `user_id` and ProfileInfo (or None if couldn't find event).
to `user_id` and ProfileInfo (or None if not join event).
"""

rows = yield self._simple_select_many_batch(
Expand Down

0 comments on commit a9610cd

Please sign in to comment.