summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/8728.bugfix1
-rw-r--r--synapse/server_notices/server_notices_manager.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.d/8728.bugfix b/changelog.d/8728.bugfix
new file mode 100644
index 0000000000..8064aad0ff
--- /dev/null
+++ b/changelog.d/8728.bugfix
@@ -0,0 +1 @@
+Fix bug where the `/_synapse/admin/v1/send_server_notice` API could send notices to non-notice rooms.
diff --git a/synapse/server_notices/server_notices_manager.py b/synapse/server_notices/server_notices_manager.py
index 0422d4c7ce..d464c75c03 100644
--- a/synapse/server_notices/server_notices_manager.py
+++ b/synapse/server_notices/server_notices_manager.py
@@ -119,7 +119,7 @@ class ServerNoticesManager:
             # manages to invite the system user to a room, that doesn't make it
             # the server notices room.
             user_ids = await self._store.get_users_in_room(room.room_id)
-            if self.server_notices_mxid in user_ids:
+            if len(user_ids) <= 2 and self.server_notices_mxid in user_ids:
                 # we found a room which our user shares with the system notice
                 # user
                 logger.info(