From 49ebf083e1b3bc3cd370a2ee336d85b9f123c7c5 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 6 Aug 2022 13:53:24 +0300 Subject: [PATCH] Files reply upload --- pleroma-cli.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pleroma-cli.sh b/pleroma-cli.sh index ec54372..830bc2a 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -804,7 +804,7 @@ delete_api_status() write_api_status() { if [ -n "$mediaattach" ]; then - media=$(upload_api_media | jj id) + media=$mediaattach post_request --url "$instance_point"/statuses \ --data-urlencode "status@$1" \ --data-raw "content_type=$content_type" \ @@ -831,7 +831,7 @@ edit_api_status() upload_api_media() { post_request --url "$instance_point"/media \ - --form "file=$mediaattach" + --form "file=$1" } write_status_menu() @@ -1011,6 +1011,18 @@ if [ "$daemon_mode" = 'yes' ]; then 'share') share_api_status $status_id ; rm "$statuses_file_action" ;; 'reply') replyto=$status_id + if [ -d "$dir_status/attachments" ]; then + attach_id='' + echo "Uploading attachments..." + for attach in "$dir_status"/attachments/*; do + attach_id=$(upload_api_media "@$attach" | jj id) + attach_id="${attach_id}," + echo $attach_id + done + mediaattach=$(echo $attach_id | sed 's/,$//g') + echo $mediaattach + fi + write_api_status $dir_status/message rm "$statuses_file_action" ;;