diff options
author | Erik Johnston <erikj@jki.re> | 2019-03-06 18:59:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 18:59:05 +0000 |
commit | ff7bd29ea98373b9f551d35140f5c7d1d280f403 (patch) | |
tree | 13e8e98685526738aa1fa415805ebfa00c5a606e | |
parent | Merge pull request #4792 from matrix-org/anoa/replication_tokens (diff) | |
parent | Newsfile (diff) | |
download | synapse-ff7bd29ea98373b9f551d35140f5c7d1d280f403.tar.xz |
Merge pull request #4817 from matrix-org/erikj/shutdown_room_message
Send message after room has been shutdown
-rw-r--r-- | changelog.d/4817.misc | 1 | ||||
-rw-r--r-- | synapse/rest/client/v1/admin.py | 22 |
2 files changed, 12 insertions, 11 deletions
diff --git a/changelog.d/4817.misc b/changelog.d/4817.misc new file mode 100644 index 0000000000..438a51dc63 --- /dev/null +++ b/changelog.d/4817.misc @@ -0,0 +1 @@ +Make shutdown API send explanation message to room after users have been forced joined. diff --git a/synapse/rest/client/v1/admin.py b/synapse/rest/client/v1/admin.py index 0201cf1186..2a29f0c2af 100644 --- a/synapse/rest/client/v1/admin.py +++ b/synapse/rest/client/v1/admin.py @@ -488,17 +488,6 @@ class ShutdownRoomRestServlet(ClientV1RestServlet): ) new_room_id = info["room_id"] - yield self.event_creation_handler.create_and_send_nonmember_event( - room_creator_requester, - { - "type": "m.room.message", - "content": {"body": message, "msgtype": "m.text"}, - "room_id": new_room_id, - "sender": new_room_user_id, - }, - ratelimit=False, - ) - requester_user_id = requester.user.to_string() logger.info("Shutting down room %r", room_id) @@ -536,6 +525,17 @@ class ShutdownRoomRestServlet(ClientV1RestServlet): kicked_users.append(user_id) + yield self.event_creation_handler.create_and_send_nonmember_event( + room_creator_requester, + { + "type": "m.room.message", + "content": {"body": message, "msgtype": "m.text"}, + "room_id": new_room_id, + "sender": new_room_user_id, + }, + ratelimit=False, + ) + aliases_for_room = yield self.store.get_aliases_for_room(room_id) yield self.store.update_aliases_for_room( |