Skip spam check for admin users

pull/2492/head
David Baker 2017-10-03 14:17:44 +01:00
parent 2a7ed700d5
commit 41fd9989a2
1 changed files with 8 additions and 8 deletions

View File

@ -213,16 +213,16 @@ class RoomMemberHandler(BaseHandler):
if effective_membership_state == "invite":
block_invite = False
if self.hs.config.block_non_admin_invites:
is_requester_admin = yield self.auth.is_server_admin(
requester.user,
)
if not is_requester_admin:
is_requester_admin = yield self.auth.is_server_admin(
requester.user,
)
if not is_requester_admin:
if (
self.hs.config.block_non_admin_invites or
not self.spam_checker.user_may_invite(requester.user)
):
block_invite = True
if not self.spam_checker.user_may_invite(requester.user):
block_invite = True
if block_invite:
raise SynapseError(
403, "Invites have been disabled on this server",