summary refs log tree commit diff
path: root/synapse/handlers/room_member.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-18 11:18:39 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-18 11:18:39 +0100
commit26305788fe23448d65d0cd0358df547e816574f2 (patch)
tree1dafe1e3220105e43b4158008ebe482e7d5400a0 /synapse/handlers/room_member.py
parentReplace inline docstrings with "Attributes" in class docstring (diff)
downloadsynapse-26305788fe23448d65d0cd0358df547e816574f2.tar.xz
Make sure we reject attempts to invite the notices user
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r--synapse/handlers/room_member.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 9b99f0f9d7..5263f09aaa 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -309,6 +309,13 @@ class RoomMemberHandler(object):
                 )
 
         if effective_membership_state == Membership.INVITE:
+            # block any attempts to invite the server notices mxid
+            if target.to_string() == self._server_notices_mxid:
+                raise SynapseError(
+                    http_client.FORBIDDEN,
+                    "Cannot invite this user",
+                )
+
             block_invite = False
 
             if (self._server_notices_mxid is not None and