diff options
author | Travis Ralston <travisr@matrix.org> | 2022-02-22 11:35:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 18:35:01 +0000 |
commit | e3fe6347be1da930b6a0ed2005b565369800a327 (patch) | |
tree | 706037fb67be7625556af1ca4ce084da934e6133 | |
parent | Better error message when failing to request from another process (#12060) (diff) | |
download | synapse-e3fe6347be1da930b6a0ed2005b565369800a327.tar.xz |
Remove excess condition on `knock->leave` check (#11900)
-rw-r--r-- | changelog.d/11900.misc | 1 | ||||
-rw-r--r-- | synapse/event_auth.py | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/11900.misc b/changelog.d/11900.misc new file mode 100644 index 0000000000..edd2852fd4 --- /dev/null +++ b/changelog.d/11900.misc @@ -0,0 +1 @@ +Remove unnecessary condition on knock->leave auth rule check. \ No newline at end of file diff --git a/synapse/event_auth.py b/synapse/event_auth.py index eca00bc975..621a3efccc 100644 --- a/synapse/event_auth.py +++ b/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 ( |