mirror of
https://mau.dev/maunium/synapse.git
synced 2025-01-05 22:44:03 +01:00
Merge pull request #1917 from matrix-org/dbkr/make_ban_reasons_work
Make kick & ban reasons work
This commit is contained in:
commit
fa467e62a9
1 changed files with 5 additions and 0 deletions
|
@ -609,6 +609,10 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
|
||||||
raise SynapseError(400, "Missing user_id key.")
|
raise SynapseError(400, "Missing user_id key.")
|
||||||
target = UserID.from_string(content["user_id"])
|
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(
|
yield self.handlers.room_member_handler.update_membership(
|
||||||
requester=requester,
|
requester=requester,
|
||||||
target=target,
|
target=target,
|
||||||
|
@ -616,6 +620,7 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
|
||||||
action=membership_action,
|
action=membership_action,
|
||||||
txn_id=txn_id,
|
txn_id=txn_id,
|
||||||
third_party_signed=content.get("third_party_signed", None),
|
third_party_signed=content.get("third_party_signed", None),
|
||||||
|
content=event_content,
|
||||||
)
|
)
|
||||||
|
|
||||||
defer.returnValue((200, {}))
|
defer.returnValue((200, {}))
|
||||||
|
|
Loading…
Reference in a new issue