mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-29 16:41:28 +00:00
Compare commits
No commits in common. "201025ff771e8481a19017c9a59402d2496109a6" and "95d04e57d13ff50c6f4d2dbe1fab029bd3a072b4" have entirely different histories.
201025ff77
...
95d04e57d1
|
@ -453,7 +453,7 @@ statuses_render()
|
||||||
dateutc=$(echo "$status" | jj created_at)
|
dateutc=$(echo "$status" | jj created_at)
|
||||||
reply_to_id=$(echo "$status" | jj in_reply_to_id)
|
reply_to_id=$(echo "$status" | jj in_reply_to_id)
|
||||||
visibility_status=$(echo "$status" | jj visibility)
|
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
|
if [ "$visibility_status" = "private" ] || [ "$visibility_status" = "direct" ]; then
|
||||||
s_f_menu=
|
s_f_menu=
|
||||||
fi
|
fi
|
||||||
|
@ -487,7 +487,7 @@ statuses_render()
|
||||||
next=0
|
next=0
|
||||||
force_stop=0
|
force_stop=0
|
||||||
while [ "$next" -eq 0 ]; do
|
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
|
case "$per_status_menu" in
|
||||||
"Next")
|
"Next")
|
||||||
next=1
|
next=1
|
||||||
|
@ -734,20 +734,24 @@ write_api_status()
|
||||||
{
|
{
|
||||||
if [ -n "$mediaattach" ]; then
|
if [ -n "$mediaattach" ]; then
|
||||||
media=$(upload_api_media | jj id)
|
media=$(upload_api_media | jj id)
|
||||||
post_request --url "$instance_point"/statuses \
|
post_request -w "%{http_code}" --url "$instance_point"/statuses \
|
||||||
--data-urlencode "status@$1" \
|
--data-urlencode "status=$1" \
|
||||||
--data-raw "content_type=$content_type" \
|
--data-urlencode "content_type=$content_type" \
|
||||||
--data-raw "visibility=$status_visibility" \
|
--data-urlencode "visibility=$status_visibility" \
|
||||||
--data-raw "in_reply_to_id=$replyto" \
|
--data-urlencode "in_reply_to_id=$replyto" \
|
||||||
--data-raw "media_ids[]=$media" \
|
--data-urlencode "media_ids[]=$media" \
|
||||||
--data-raw "to[]=$mentions_reply"
|
--data-urlencode "to[]=$mentions_reply" \
|
||||||
|
--output /dev/null
|
||||||
|
echo "$http_code"
|
||||||
else
|
else
|
||||||
post_request --url "$instance_point"/statuses \
|
post_request -w "%{http_code}" --url "$instance_point"/statuses \
|
||||||
--data-urlencode "status@$1" \
|
--data-urlencode "status=$1" \
|
||||||
--data-raw "content_type=$content_type" \
|
--data-urlencode "content_type=$content_type" \
|
||||||
--data-raw "visibility=$status_visibility" \
|
--data-urlencode "visibility=$status_visibility" \
|
||||||
--data-raw "in_reply_to_id=$replyto" \
|
--data-urlencode "in_reply_to_id=$replyto" \
|
||||||
--data-raw "to[]=$mentions_reply"
|
--data-urlencode "to[]=$mentions_reply" \
|
||||||
|
--output /dev/null
|
||||||
|
echo "$http_code"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,7 +768,7 @@ write_status_menu()
|
||||||
status_visibility="$default_visibility"
|
status_visibility="$default_visibility"
|
||||||
replyto=$1
|
replyto=$1
|
||||||
mediaattach=
|
mediaattach=
|
||||||
status_data_send=
|
http_code=
|
||||||
if [ -n "$sub_menu_lvl" ]; then
|
if [ -n "$sub_menu_lvl" ]; then
|
||||||
sub_menu_lvl=2
|
sub_menu_lvl=2
|
||||||
level=2
|
level=2
|
||||||
|
@ -789,15 +793,13 @@ write_status_menu()
|
||||||
if [ -n "$mediaattach" ]; then
|
if [ -n "$mediaattach" ]; then
|
||||||
echo "Attachments: $mediaattach"
|
echo "Attachments: $mediaattach"
|
||||||
fi
|
fi
|
||||||
if [ -n "$(echo "$status_data_send" | jj id)" ]; then
|
if [ -n "$http_code" ]; then
|
||||||
echo 'Send state: OK'
|
echo "Send state: $http_code"
|
||||||
elif [ -n "$(echo "$status_data_send" | jj error)" ]; then
|
|
||||||
echo "Send state: ERR: $(echo "$status_data_send" | jj error)"
|
|
||||||
fi
|
fi
|
||||||
wrirepostmenu=$(echo "Edit\nSend\nAdd attach\nAdd recipient\nChange type\nVisiblity\nReset\nBack\nMain menu" | fzy)
|
wrirepostmenu=$(echo "Edit\nSend\nAdd attach\nAdd recipient\nChange type\nVisiblity\nReset\nBack\nMain menu" | fzy)
|
||||||
case $wrirepostmenu in
|
case $wrirepostmenu in
|
||||||
"Edit") $EDITOR tmp_status.md ;;
|
"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")
|
"Add attach")
|
||||||
echo 'Input path to attach (ex. @image.png or @/full/path/to/attach.png)'
|
echo 'Input path to attach (ex. @image.png or @/full/path/to/attach.png)'
|
||||||
read mediaattach
|
read mediaattach
|
||||||
|
|
Loading…
Reference in a new issue