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 2 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.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in Synapse 1.37.0rc1 (when knocking was added) where event authorization could fail on valid knocks to a room.
turt2live marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def _is_membership_change_allowed(

# Require the user to be in the room for membership changes other than join/knock.
if Membership.JOIN != membership and (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are all these conditions written backwards 🤯

RoomVersion.msc2403_knocking and Membership.KNOCK != membership
room_version.msc2403_knocking and Membership.KNOCK != membership
turt2live marked this conversation as resolved.
Show resolved Hide resolved
):
# If the user has been invited or has knocked, they are allowed to change their
# membership event to leave
Expand Down