Compare commits

..

No commits in common. "201025ff771e8481a19017c9a59402d2496109a6" and "95d04e57d13ff50c6f4d2dbe1fab029bd3a072b4" have entirely different histories.

View file

@ -453,7 +453,7 @@ statuses_render()
dateutc=$(echo "$status" | jj created_at)
reply_to_id=$(echo "$status" | jj in_reply_to_id)
visibility_status=$(echo "$status" | jj visibility)
s_f_menu='\nShare\nShare and favorite'
s_f_menu='\nShare and favorite\nShare'
if [ "$visibility_status" = "private" ] || [ "$visibility_status" = "direct" ]; then
s_f_menu=
fi
@ -487,7 +487,7 @@ statuses_render()
next=0
force_stop=0
while [ "$next" -eq 0 ]; do
per_status_menu=$(echo "Next$menuattachments\nFavorite$s_f_menu\nBookmark\nReply\nBack" | fzy)
per_status_menu=$(echo "Next$menuattachments"$s_f_menu"\nFavorite\nBookmark\nReply\nBack" | fzy)
case "$per_status_menu" in
"Next")
next=1
@ -734,20 +734,24 @@ write_api_status()
{
if [ -n "$mediaattach" ]; then
media=$(upload_api_media | jj id)
post_request --url "$instance_point"/statuses \
--data-urlencode "status@$1" \
--data-raw "content_type=$content_type" \
--data-raw "visibility=$status_visibility" \
--data-raw "in_reply_to_id=$replyto" \
--data-raw "media_ids[]=$media" \
--data-raw "to[]=$mentions_reply"
post_request -w "%{http_code}" --url "$instance_point"/statuses \
--data-urlencode "status=$1" \
--data-urlencode "content_type=$content_type" \
--data-urlencode "visibility=$status_visibility" \
--data-urlencode "in_reply_to_id=$replyto" \
--data-urlencode "media_ids[]=$media" \
--data-urlencode "to[]=$mentions_reply" \
--output /dev/null
echo "$http_code"
else
post_request --url "$instance_point"/statuses \
--data-urlencode "status@$1" \
--data-raw "content_type=$content_type" \
--data-raw "visibility=$status_visibility" \
--data-raw "in_reply_to_id=$replyto" \
--data-raw "to[]=$mentions_reply"
post_request -w "%{http_code}" --url "$instance_point"/statuses \
--data-urlencode "status=$1" \
--data-urlencode "content_type=$content_type" \
--data-urlencode "visibility=$status_visibility" \
--data-urlencode "in_reply_to_id=$replyto" \
--data-urlencode "to[]=$mentions_reply" \
--output /dev/null
echo "$http_code"
fi
}
@ -764,7 +768,7 @@ write_status_menu()
status_visibility="$default_visibility"
replyto=$1
mediaattach=
status_data_send=
http_code=
if [ -n "$sub_menu_lvl" ]; then
sub_menu_lvl=2
level=2
@ -789,15 +793,13 @@ write_status_menu()
if [ -n "$mediaattach" ]; then
echo "Attachments: $mediaattach"
fi
if [ -n "$(echo "$status_data_send" | jj id)" ]; then
echo 'Send state: OK'
elif [ -n "$(echo "$status_data_send" | jj error)" ]; then
echo "Send state: ERR: $(echo "$status_data_send" | jj error)"
if [ -n "$http_code" ]; then
echo "Send state: $http_code"
fi
wrirepostmenu=$(echo "Edit\nSend\nAdd attach\nAdd recipient\nChange type\nVisiblity\nReset\nBack\nMain menu" | fzy)
case $wrirepostmenu in
"Edit") $EDITOR tmp_status.md ;;
"Send") status_data_send=$(write_api_status tmp_status.md) ;;
"Send") http_code=$(write_api_status "$(cat tmp_status.md)") ;;
"Add attach")
echo 'Input path to attach (ex. @image.png or @/full/path/to/attach.png)'
read mediaattach