From 1c65a1eb36a992513e9b1eb930ffbb79b127233f Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sun, 22 Jul 2018 00:29:32 +0800 Subject: redact --- bash/api.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bash/api.sh b/bash/api.sh index 0757a60..5f479da 100644 --- a/bash/api.sh +++ b/bash/api.sh @@ -117,3 +117,12 @@ matrix_send() { # args: roomid, eventType(m.room.message), txn, msg local _out="$(req PUT "$_url" -d "$4")" jq . "$_out" } + +# 6.5.2.1 PUT /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId} + +matrix_redact() { # args: roomid, event id, txn, reason + local _url="$SERVER_URL/_matrix/client/r0/rooms/$1/redact/$2/$3?access_token=$TOKEN" + local _out="$(req PUT "$_url" -d "{\"reason\":\"$4\"}")" + jq . "$_out" +} + -- cgit v1.2.3