diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-09-19 16:08:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 16:08:14 +0100 |
commit | aa620d09a01c226d7a6fbc0d839d8abd347a2b2e (patch) | |
tree | 497fc7af84c9a510e19bbff34e142cf6a799c52b /synapse/handlers/federation.py | |
parent | add some comments to on_exchange_third_party_invite_request (diff) | |
download | synapse-aa620d09a01c226d7a6fbc0d839d8abd347a2b2e.tar.xz |
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.
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 2637f41dcd..18f87cad67 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -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") |