From 6e80f2c43a6c794434ccbd6cf81b02b0f8c50e2d Mon Sep 17 00:00:00 2001 From: timedout Date: Mon, 12 Jan 2026 18:00:33 +0000 Subject: [PATCH] Fall back to checking power levels when sourcing local restricted join users (#19321) Fix https://github.com/element-hq/synapse/issues/19120 by always falling back to checking power levels for local users if a local creator cannot be found in a v12 room. Complement tests: https://github.com/matrix-org/complement/pull/836 --- changelog.d/19321.bugfix | 1 + synapse/handlers/event_auth.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/19321.bugfix diff --git a/changelog.d/19321.bugfix b/changelog.d/19321.bugfix new file mode 100644 index 0000000000..9292ca5ebf --- /dev/null +++ b/changelog.d/19321.bugfix @@ -0,0 +1 @@ +Fix joining a restricted v12 room locally when no local room creator is present but local users with sufficient power levels are. Contributed by @nexy7574. \ No newline at end of file diff --git a/synapse/handlers/event_auth.py b/synapse/handlers/event_auth.py index 4f2657bba8..daa8dd5eba 100644 --- a/synapse/handlers/event_auth.py +++ b/synapse/handlers/event_auth.py @@ -172,7 +172,7 @@ class EventAuthHandler: if len(local_creators) > 0: chosen_user = local_creators.pop() # random creator user_power_level = CREATOR_POWER_LEVEL - else: + if chosen_user is None: chosen_user = max( local_users_in_room, key=lambda user: users.get(user, users_default_level),