Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Check support room has only two users before sending a notice (#8728)
Browse files Browse the repository at this point in the history
* Check support room has only two users

* Create 8728.bugfix

* Update synapse/server_notices/server_notices_manager.py

Co-authored-by: Erik Johnston <[email protected]>

Co-authored-by: Erik Johnston <[email protected]>
  • Loading branch information
Half-Shot and erikjohnston authored Nov 11, 2020
1 parent eedaf90 commit 89700df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/8728.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where the `/_synapse/admin/v1/send_server_notice` API could send notices to non-notice rooms.
2 changes: 1 addition & 1 deletion synapse/server_notices/server_notices_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def get_or_create_notice_room_for_user(self, user_id: str) -> str:
# 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(
Expand Down

0 comments on commit 89700df

Please sign in to comment.