summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-07-22 00:29:32 +0800
committerIru Cai <mytbk920423@gmail.com>2018-07-22 00:29:32 +0800
commit1c65a1eb36a992513e9b1eb930ffbb79b127233f (patch)
tree11be9f7b44db79fecd3a7883f0cbe8be4ba13c6e
parent633487a6b786c42a07e1da492faccff83cec01aa (diff)
downloadmatrix-curl-master.tar.xz
-rw-r--r--bash/api.sh9
1 files changed, 9 insertions, 0 deletions
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"
+}
+