diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-04-16 16:41:01 +0100 |
---|---|---|
committer | Erik Johnston <erikj@jki.re> | 2019-04-16 16:41:01 +0100 |
commit | e6218e48800a613e6c8f3d008cd90e4a01194fe5 (patch) | |
tree | b60dd24b637723a8cee735d67d80a3be713f89d9 /synapse/handlers/federation.py | |
parent | Merge branch 'develop' into dinsic (diff) | |
download | synapse-e6218e48800a613e6c8f3d008cd90e4a01194fe5.tar.xz |
[DINSIC] Block internal users from inviting external users to a public room (#5061)
Co-Authored-By: babolivier <contact@brendanabolivier.com>
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 b568d0627c..469f271849 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -1340,9 +1340,12 @@ class FederationHandler(BaseHandler): if self.hs.config.block_non_admin_invites: raise SynapseError(403, "This server does not accept room invites") + is_published = yield self.store.is_room_published(event.room_id) + if not self.spam_checker.user_may_invite( event.sender, event.state_key, None, room_id=event.room_id, new_room=False, + published_room=is_published, ): raise SynapseError( 403, "This user is not permitted to send invites to this server/user" |