summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2017-02-14 16:10:06 +0000
committerGitHub <noreply@github.com>2017-02-14 16:10:06 +0000
commitfa467e62a925bdc509f4db5106152789258447ce (patch)
treebd398311b9c543d56cb4bbb584998609acaa8505 /synapse/rest/client
parentMerge pull request #1873 from matrix-org/erikj/delete_push_actions (diff)
parentMake kick & ban reasons work (diff)
downloadsynapse-fa467e62a925bdc509f4db5106152789258447ce.tar.xz
Merge pull request #1917 from matrix-org/dbkr/make_ban_reasons_work
Make kick & ban reasons work
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v1/room.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index 2ebf5e59a0..728e3df0e3 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -609,6 +609,10 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
                 raise SynapseError(400, "Missing user_id key.")
             target = UserID.from_string(content["user_id"])
 
+        event_content = None
+        if 'reason' in content and membership_action in ['kick', 'ban']:
+            event_content = {'reason': content['reason']}
+
         yield self.handlers.room_member_handler.update_membership(
             requester=requester,
             target=target,
@@ -616,6 +620,7 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
             action=membership_action,
             txn_id=txn_id,
             third_party_signed=content.get("third_party_signed", None),
+            content=event_content,
         )
 
         defer.returnValue((200, {}))