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

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowJonathan committed May 22, 2022
1 parent 890d63e commit fc51b36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,19 +678,19 @@ async def get_users_who_share_room_with_user(
)
async def get_mutual_rooms_between_users(
self, user_ids: FrozenSet[str], cache_context: _CacheContext
) -> Set[str]:
) -> FrozenSet[str]:
"""Returns the set of rooms that all users in user_ids share"""
shared_room_ids = None
shared_room_ids: Optional[FrozenSet[str]] = None
for user_id in user_ids:
room_ids = await self.get_rooms_for_user(
user_id, on_invalidate=cache_context.invalidate
)
if shared_room_ids is None:
shared_room_ids = room_ids
else:
if shared_room_ids is not None:
shared_room_ids &= room_ids
else:
shared_room_ids = room_ids

return shared_room_ids or set()
return shared_room_ids or frozenset()

async def get_joined_users_from_context(
self, event: EventBase, context: EventContext
Expand Down

0 comments on commit fc51b36

Please sign in to comment.