Skip spam check for admin users

This commit is contained in:
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,14 +213,14 @@ class RoomMemberHandler(BaseHandler):
if effective_membership_state == "invite": if effective_membership_state == "invite":
block_invite = False block_invite = False
if self.hs.config.block_non_admin_invites:
is_requester_admin = yield self.auth.is_server_admin( is_requester_admin = yield self.auth.is_server_admin(
requester.user, requester.user,
) )
if not is_requester_admin: if not is_requester_admin:
block_invite = True if (
self.hs.config.block_non_admin_invites or
if not self.spam_checker.user_may_invite(requester.user): not self.spam_checker.user_may_invite(requester.user)
):
block_invite = True block_invite = True
if block_invite: if block_invite: