From 3d3922f80ee7672c4171bd7169f3a2e273e151d5 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 18 Feb 2022 13:21:14 +0200 Subject: [PATCH] matrix-*.bash: update deprecated endpoint --- bash/matrix-tombstone-room.bash | 2 +- bash/matrix-upgrade-room.bash | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bash/matrix-tombstone-room.bash b/bash/matrix-tombstone-room.bash index d41be3e..caea231 100755 --- a/bash/matrix-tombstone-room.bash +++ b/bash/matrix-tombstone-room.bash @@ -10,5 +10,5 @@ NEWROOMID= HOMESERVER=matrix-client.matrix.org set -x -curl -s -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"replacement_room\":\"$NEWROOMID\"}" "https://$HOMESERVER/_matrix/client/r0/rooms/$OLDROOMID/state/m.room.tombstone" +curl -s -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"replacement_room\":\"$NEWROOMID\"}" "https://$HOMESERVER/_matrix/client/v3/rooms/$OLDROOMID/state/m.room.tombstone" set +x diff --git a/bash/matrix-upgrade-room.bash b/bash/matrix-upgrade-room.bash index a7571ca..eea5b09 100755 --- a/bash/matrix-upgrade-room.bash +++ b/bash/matrix-upgrade-room.bash @@ -18,8 +18,8 @@ set -x # Creating the new room pointing to old one # Thanks to https://gist.github.com/turt2live/a99c8e794d6115d4ddfaadb72aabf063#gistcomment-3071780 for the awk -NEWROOMID=$(curl -s -X POST -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"name\":\"$NEWROOMNAME\",\"room_version\":\"$ROOMVERSION\",\"creation_content\":{\"predecessor\":{\"room_id\":\"$OLDROOMID\",\"event_id\":\"$LASTEVENTINOLDROOM\"}}}" https://$HOMESERVER/_matrix/client/r0/createRoom | awk -F\" '{ printf $4 }') +NEWROOMID=$(curl -s -X POST -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"name\":\"$NEWROOMNAME\",\"room_version\":\"$ROOMVERSION\",\"creation_content\":{\"predecessor\":{\"room_id\":\"$OLDROOMID\",\"event_id\":\"$LASTEVENTINOLDROOM\"}}}" https://$HOMESERVER/_matrix/client/v3/createRoom | awk -F\" '{ printf $4 }') # Sending a tombstone -curl -s -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"replacement_room\":\"$NEWROOMID\"}" "https://$HOMESERVER/_matrix/client/r0/rooms/$OLDROOMID/state/m.room.tombstone" +curl -s -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"replacement_room\":\"$NEWROOMID\"}" "https://$HOMESERVER/_matrix/client/v3/rooms/$OLDROOMID/state/m.room.tombstone" set +x