mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Skip spam check for admin users
This commit is contained in:
parent
2a7ed700d5
commit
41fd9989a2
@ -213,16 +213,16 @@ 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:
|
if (
|
||||||
|
self.hs.config.block_non_admin_invites or
|
||||||
|
not self.spam_checker.user_may_invite(requester.user)
|
||||||
|
):
|
||||||
block_invite = True
|
block_invite = True
|
||||||
|
|
||||||
if not self.spam_checker.user_may_invite(requester.user):
|
|
||||||
block_invite = True
|
|
||||||
|
|
||||||
if block_invite:
|
if block_invite:
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
403, "Invites have been disabled on this server",
|
403, "Invites have been disabled on this server",
|
||||||
|
Loading…
Reference in New Issue
Block a user