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

Commit e3fe634

Browse files
authored
Remove excess condition on knock->leave check (#11900)
1 parent 6d14b3d commit e3fe634

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

changelog.d/11900.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove unnecessary condition on knock->leave auth rule check.

synapse/event_auth.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ def _is_membership_change_allowed(
374374
return
375375

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

0 commit comments

Comments
 (0)