diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 10:50:26 -0500 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-05-22 10:50:26 -0500 |
commit | a8990fa2ec98ea14493515a92d6228729024409b (patch) | |
tree | a0ce94c793d02e80ac95ec43a16c3b11a1884efa /synapse/handlers/federation.py | |
parent | rest of the changes (diff) | |
parent | Merge pull request #3262 from matrix-org/rav/has_already_consented (diff) | |
download | synapse-a8990fa2ec98ea14493515a92d6228729024409b.tar.xz |
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index f39233d846..ba3ede8024 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -81,6 +81,7 @@ class FederationHandler(BaseHandler): self.pusher_pool = hs.get_pusherpool() self.spam_checker = hs.get_spam_checker() self.event_creation_handler = hs.get_event_creation_handler() + self._server_notices_mxid = hs.config.server_notices_mxid # When joining a room we need to queue any events for that room up self.room_queues = {} @@ -1180,6 +1181,13 @@ class FederationHandler(BaseHandler): if not self.is_mine_id(event.state_key): raise SynapseError(400, "The invite event must be for this server") + # block any attempts to invite the server notices mxid + if event.state_key == self._server_notices_mxid: + raise SynapseError( + http_client.FORBIDDEN, + "Cannot invite this user", + ) + event.internal_metadata.outlier = True event.internal_metadata.invite_from_remote = True |