forked from MirrorHub/synapse
Use dedicated get_local_users_in_room
to find local users when calculating join_authorised_via_users_server
of a /make_join
request (#13606)
Use dedicated `get_local_users_in_room` to find local users when calculating `join_authorised_via_users_server` ("the authorising user for joining a restricted room") of a `/make_join` request. Found while working on https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755 but it's not related.
This commit is contained in:
parent
371db86a86
commit
c807b814ae
2 changed files with 4 additions and 6 deletions
1
changelog.d/13606.misc
Normal file
1
changelog.d/13606.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Use dedicated `get_local_users_in_room(room_id)` function to find local users when calculating `join_authorised_via_users_server` of a `/make_join` request.
|
|
@ -129,12 +129,9 @@ class EventAuthHandler:
|
||||||
else:
|
else:
|
||||||
users = {}
|
users = {}
|
||||||
|
|
||||||
# Find the user with the highest power level.
|
# Find the user with the highest power level (only interested in local
|
||||||
users_in_room = await self._store.get_users_in_room(room_id)
|
# users).
|
||||||
# Only interested in local users.
|
local_users_in_room = await self._store.get_local_users_in_room(room_id)
|
||||||
local_users_in_room = [
|
|
||||||
u for u in users_in_room if get_domain_from_id(u) == self._server_name
|
|
||||||
]
|
|
||||||
chosen_user = max(
|
chosen_user = max(
|
||||||
local_users_in_room,
|
local_users_in_room,
|
||||||
key=lambda user: users.get(user, users_default_level),
|
key=lambda user: users.get(user, users_default_level),
|
||||||
|
|
Loading…
Reference in a new issue