Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to kick themselves #3157

Merged
merged 2 commits into from
Nov 22, 2023
Merged

Allow users to kick themselves #3157

merged 2 commits into from
Nov 22, 2023

Conversation

BtbN
Copy link
Contributor

@BtbN BtbN commented Jul 23, 2023

As per the spec: https://spec.matrix.org/v1.7/rooms/v10/#authorization-rules

"If membership is leave"
->
"If the sender matches state_key, allow if and only if that user’s current membership state is invite, join, or knock."

I.e. a user can kick themselves. Bridges use this to make a user leave while giving a reason.

Some recent change (likely 8ea1a11 but I'm not 100% sure) changed that behaviour, resulting in heisenbridge being unable to make users leave while giving a reason.
This works fine on Synapse.

As per the spec: https://spec.matrix.org/v1.7/rooms/v10/#authorization-rules

"If membership is leave"
->
"If the sender matches state_key, allow if and only if that user’s
current membership state is invite, join, or knock."

I.e. a user can kick themselves. Bridges use this to make a user leave
while giving a reason.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
@BtbN BtbN requested a review from a team as a code owner July 23, 2023 17:52
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (7863a40) 65.71% compared to head (f84b16d) 65.71%.
Report is 2 commits behind head on main.

Files Patch % Lines
clientapi/routing/membership.go 25.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3157   +/-   ##
=======================================
  Coverage   65.71%   65.71%           
=======================================
  Files         507      507           
  Lines       57291    57291           
=======================================
  Hits        37651    37651           
  Misses      15830    15830           
  Partials     3810     3810           
Flag Coverage Δ
unittests 49.50% <25.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kegsay kegsay merged commit c4528b2 into matrix-org:main Nov 22, 2023
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants