forked from MirrorHub/synapse
Merge pull request #3999 from matrix-org/erikj/fix_3pid_invite_rejetion
Fix handling of rejected threepid invites
This commit is contained in:
commit
8935ec5a93
2 changed files with 3 additions and 5 deletions
1
changelog.d/3999.bugfix
Normal file
1
changelog.d/3999.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix handling of rejected threepid invites
|
|
@ -155,10 +155,7 @@ def check(event, auth_events, do_sig_check=True, do_size_check=True):
|
||||||
|
|
||||||
if user_level < invite_level:
|
if user_level < invite_level:
|
||||||
raise AuthError(
|
raise AuthError(
|
||||||
403, (
|
403, "You don't have permission to invite users",
|
||||||
"You cannot issue a third party invite for %s." %
|
|
||||||
(event.content.display_name,)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.debug("Allowing! %s", event)
|
logger.debug("Allowing! %s", event)
|
||||||
|
@ -305,7 +302,7 @@ def _is_membership_change_allowed(event, auth_events):
|
||||||
|
|
||||||
if user_level < invite_level:
|
if user_level < invite_level:
|
||||||
raise AuthError(
|
raise AuthError(
|
||||||
403, "You cannot invite user %s." % target_user_id
|
403, "You don't have permission to invite users",
|
||||||
)
|
)
|
||||||
elif Membership.JOIN == membership:
|
elif Membership.JOIN == membership:
|
||||||
# Joins are valid iff caller == target and they were:
|
# Joins are valid iff caller == target and they were:
|
||||||
|
|
Loading…
Reference in a new issue