added: reply to status

This commit is contained in:
localhost_frssoft 2022-04-13 13:50:56 +03:00
parent eb2b5846eb
commit 74f7bf9968

View file

@ -156,7 +156,7 @@ timeline_menu()
indexator=$(expr $indexator - 1)
echo '_____'
done
menu=$(echo 'Prev\nNext\nShare\nThread\nMain menu' | fzy)
menu=$(echo 'Prev\nNext\nReply\nShare\nThread\nMain menu' | fzy)
case $menu in
"Prev")
indexator=$(expr $max_statuses - 1)
@ -172,6 +172,11 @@ timeline_menu()
offset=$(jj -i preload 0.id)
json=$(timeline_api $offset)
;;
"Reply")
echo 'Input id'
read status_id
write_status_menu $status_id
;;
"Share")
echo 'Input id (s - stop)'
sharemode=1
@ -208,7 +213,8 @@ write_api_status()
curl -s --compressed -H "Authorization: Bearer $auth" --url $instance_point/statuses \
--data-urlencode "status=$1" \
--data-urlencode "content_type=$content_type" \
--data-urlencode "visibility=$status_visibility"
--data-urlencode "visibility=$status_visibility" \
--data-urlencode "in_reply_to_id=$replyto"
}
write_status_menu()
@ -216,6 +222,7 @@ write_status_menu()
touch tmp_status.md
content_type="$default_content_type"
status_visibility="$default_visibility"
replyto=$1
sub_menu_lvl=1
while [ $sub_menu_lvl -eq 1 ]; do
clear
@ -225,6 +232,9 @@ write_status_menu()
echo "Chars: $(cat tmp_status.md | wc -m)"
echo "Visiblity: $status_visibility"
echo "Content type: $content_type"
if [ -n "$replyto" ]; then
echo "Reply to: $replyto"
fi
wrirepostmenu=$(echo "Write\nSend\nChange type\nVisiblity\nMain menu" | fzy)
case $wrirepostmenu in
"Write") echo > tmp_status.md; $EDITOR tmp_status.md ;;