Skip to content
Snippets Groups Projects
Unverified Commit 89700dfb authored by Will Hunt's avatar Will Hunt Committed by GitHub
Browse files

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: default avatarErik Johnston <erik@matrix.org>

Co-authored-by: default avatarErik Johnston <erik@matrix.org>
parent eedaf90c
No related branches found
No related tags found
No related merge requests found
Fix bug where the `/_synapse/admin/v1/send_server_notice` API could send notices to non-notice rooms.
...@@ -119,7 +119,7 @@ class ServerNoticesManager: ...@@ -119,7 +119,7 @@ class ServerNoticesManager:
# manages to invite the system user to a room, that doesn't make it # manages to invite the system user to a room, that doesn't make it
# the server notices room. # the server notices room.
user_ids = await self._store.get_users_in_room(room.room_id) 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 # we found a room which our user shares with the system notice
# user # user
logger.info( logger.info(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment