Skip spam check for admin users
parent
2a7ed700d5
commit
41fd9989a2
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue