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

Remove excess condition on knock->leave check #11900

Merged
merged 6 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11900.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unnecessary condition on knock->leave auth rule check.
6 changes: 3 additions & 3 deletions synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ def _is_membership_change_allowed(
return

# Require the user to be in the room for membership changes other than join/knock.
if Membership.JOIN != membership and (
RoomVersion.msc2403_knocking and Membership.KNOCK != membership
):
# Note that the room version check for knocking is done implicitly by `caller_knocked`
# and the ability to set a membership of `knock` in the first place.
if Membership.JOIN != membership and Membership.KNOCK != membership:
# If the user has been invited or has knocked, they are allowed to change their
# membership event to leave
if (
Expand Down