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

Commit

Permalink
Merge pull request #3999 from matrix-org/erikj/fix_3pid_invite_rejetion
Browse files Browse the repository at this point in the history
Fix handling of rejected threepid invites
  • Loading branch information
erikjohnston authored Oct 3, 2018
2 parents 81e2813 + 52e6e81 commit 8935ec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
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

0 comments on commit 8935ec5

Please sign in to comment.