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

Commit

Permalink
Use dedidcated get_local_users_in_room when finding local users
Browse files Browse the repository at this point in the history
Found while working on #13575 (comment)
  • Loading branch information
MadLittleMods committed Aug 23, 2022
1 parent 3dd175b commit 78ae9b3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions synapse/handlers/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ async def get_user_which_could_invite(
else:
users = {}

# Find the user with the highest power level.
users_in_room = await self._store.get_users_in_room(room_id)
# Only interested in local users.
local_users_in_room = [
u for u in users_in_room if get_domain_from_id(u) == self._server_name
]
# Find the user with the highest power level (only interested in local
# users).
local_users_in_room = await self._store.get_local_users_in_room(room_id)
chosen_user = max(
local_users_in_room,
key=lambda user: users.get(user, users_default_level),
Expand Down

0 comments on commit 78ae9b3

Please sign in to comment.