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

Commit

Permalink
Merge pull request #1917 from matrix-org/dbkr/make_ban_reasons_work
Browse files Browse the repository at this point in the history
Make kick & ban reasons work
  • Loading branch information
dbkr authored Feb 14, 2017
2 parents 795f8e3 + 355d62c commit fa467e6
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit fa467e6

Please sign in to comment.