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

Fix handling of rejected threepid invites #3999

Merged
merged 3 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all 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/3999.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix handling of rejected threepid invites
7 changes: 2 additions & 5 deletions synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ def check(event, auth_events, do_sig_check=True, do_size_check=True):

if user_level < invite_level:
raise AuthError(
403, (
"You cannot issue a third party invite for %s." %
(event.content.display_name,)
)
403, "You don't have permission to invite users",
)
else:
logger.debug("Allowing! %s", event)
Expand Down Expand Up @@ -305,7 +302,7 @@ def _is_membership_change_allowed(event, auth_events):

if user_level < invite_level:
raise AuthError(
403, "You cannot invite user %s." % target_user_id
403, "You don't have permission to invite users",
)
elif Membership.JOIN == membership:
# Joins are valid iff caller == target and they were:
Expand Down