mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:46:01 -04:00
Add a config option to block all room invites (#2457)
- allows sysadmins the ability to lock down their servers so that people can't send their users room invites.
This commit is contained in:
parent
2eabdf3f98
commit
aa620d09a0
5 changed files with 44 additions and 0 deletions
|
@ -1074,6 +1074,9 @@ class FederationHandler(BaseHandler):
|
|||
if is_blocked:
|
||||
raise SynapseError(403, "This room has been blocked on this server")
|
||||
|
||||
if self.hs.config.block_non_admin_invites:
|
||||
raise SynapseError(403, "This server does not accept room invites")
|
||||
|
||||
membership = event.content.get("membership")
|
||||
if event.type != EventTypes.Member or membership != Membership.INVITE:
|
||||
raise SynapseError(400, "The event was not an m.room.member invite event")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue