forked from MirrorHub/synapse
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>
This commit is contained in:
parent
eedaf90c84
commit
89700dfb8c
1
changelog.d/8728.bugfix
Normal file
1
changelog.d/8728.bugfix
Normal file
|
@ -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…
Reference in a new issue