Check support room has only two users before sending a notice (#8728)

* Check support room has only two users

* Create 8728.bugfix

* Update synapse/server_notices/server_notices_manager.py

Co-authored-by: Erik Johnston <erik@matrix.org>

Co-authored-by: Erik Johnston <erik@matrix.org>
code_spécifique_watcha
Will Hunt 4 years ago committed by GitHub
parent eedaf90c84
commit 89700dfb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/8728.bugfix
  2. 2
      synapse/server_notices/server_notices_manager.py

@ -0,0 +1 @@
Fix bug where the `/_synapse/admin/v1/send_server_notice` API could send notices to non-notice rooms.

@ -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(

Loading…
Cancel
Save