Browse Source

Remove excess condition on `knock->leave` check (#11900)

Travis Ralston 2 years ago
parent
commit
e3fe6347be
2 changed files with 4 additions and 3 deletions
  1. 1 0
      changelog.d/11900.misc
  2. 3 3
      synapse/event_auth.py

+ 1 - 0
changelog.d/11900.misc

@@ -0,0 +1 @@
+Remove unnecessary condition on knock->leave auth rule check.

+ 3 - 3
synapse/event_auth.py

@@ -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 (