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

Commit c807b81

Browse files
authoredAug 24, 2022
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 #13575 (comment) but it's not related.
1 parent 371db86 commit c807b81

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎changelog.d/13606.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

‎synapse/handlers/event_auth.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,9 @@ async def get_user_which_could_invite(
129129
else:
130130
users = {}
131131

132-
# Find the user with the highest power level.
133-
users_in_room = await self._store.get_users_in_room(room_id)
134-
# Only interested in local users.
135-
local_users_in_room = [
136-
u for u in users_in_room if get_domain_from_id(u) == self._server_name
137-
]
132+
# Find the user with the highest power level (only interested in local
133+
# users).
134+
local_users_in_room = await self._store.get_local_users_in_room(room_id)
138135
chosen_user = max(
139136
local_users_in_room,
140137
key=lambda user: users.get(user, users_default_level),

0 commit comments

Comments
 (0)
This repository has been archived.