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

Make kick & ban reasons work #1917

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,18 @@ def on_POST(self, request, room_id, membership_action, txn_id=None):
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,
room_id=room_id,
action=membership_action,
txn_id=txn_id,
third_party_signed=content.get("third_party_signed", None),
content=event_content,
)

defer.returnValue((200, {}))
Expand Down