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

Commit

Permalink
Remove excess condition on knock->leave check (#11900)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Feb 22, 2022
1 parent 6d14b3d commit e3fe634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit e3fe634

Please sign in to comment.