mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2025-01-12 05:29:31 +00:00
Removed some code...
This commit is contained in:
parent
02fb276232
commit
4b3a079365
194
pleroma-cli.sh
194
pleroma-cli.sh
|
@ -436,125 +436,6 @@ status_api_one()
|
|||
default_curl_opt "$instance_point/statuses/$1"
|
||||
}
|
||||
|
||||
statuses_render()
|
||||
{
|
||||
if [ "$reversed_statuses" = 'true' ]; then
|
||||
ids_massive=$(echo "$ids_massive" | tr ' ' '\n' | tac | tr '\n' ' ')
|
||||
fi
|
||||
export instance
|
||||
echo "$jsonmassive" | ./utils/statuses2files.sh
|
||||
for i in $ids_massive; do
|
||||
status=$(echo "$jsonmassive" | jj "#[id=$i]")
|
||||
reblog=$(echo "$status" | jj reblog.id)
|
||||
if [ "$hide_reblogs" = 'true' ] && [ -n "$reblog" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
sensitive=$(echo "$status" | jj sensitive)
|
||||
sensitive_reblog=$(echo "$status" | jj reblog.sensitive)
|
||||
|
||||
if [ -n "$reblog" ]; then
|
||||
if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive_reblog" = 'true' ]; then
|
||||
continue
|
||||
fi
|
||||
if [ "$nsfw_only" = 'true' ] && [ "$sensitive_reblog" = 'false' ]; then
|
||||
continue
|
||||
fi
|
||||
else
|
||||
if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then
|
||||
continue
|
||||
fi
|
||||
if [ "$nsfw_only" = 'true' ] && [ "$sensitive" = 'false' ]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
whoacct=$(echo "$status" | jj account.acct)
|
||||
reblogacct=$(echo "$status" | jj reblog.account.acct)
|
||||
uri=$(echo "$status" | jj uri)
|
||||
id_status=$(echo "$status" | jj id)
|
||||
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'
|
||||
edit_del_menu=
|
||||
if [ "$whoacct" = "$me_acct" ]; then
|
||||
edit_del_menu='\nEdit\nDelete'
|
||||
fi
|
||||
if [ "$visibility_status" = "private" ] || [ "$visibility_status" = "direct" ]; then
|
||||
s_f_menu=
|
||||
fi
|
||||
echo "| $(date -d "$dateutc" "$format_time") $visibility_status $whoacct"
|
||||
echo "| <$id_status> $uri"
|
||||
if [ -n "$reply_to_id" ]; then
|
||||
echo "| Reply to: $reply_to_id"
|
||||
fi
|
||||
if [ -n "$reblog" ]; then
|
||||
echo "| $boost_symbol $reblog $reblogacct"
|
||||
id_status="$reblog"
|
||||
fi
|
||||
spoiler_text=$(echo "$status" | jj spoiler_text)
|
||||
if [ -n "$spoiler_text" ]; then
|
||||
echo "#[$spoiler_text]"
|
||||
fi
|
||||
if [ "$sensitive" = 'true' -o "$sensitive_reblog" = 'true' ]; then
|
||||
echo '[NSFW]'
|
||||
fi
|
||||
status_content=$(echo "$status" | jj -r content | delqse | html_to_txt_render)
|
||||
pgp_crypted=$(echo "$status_content" | find_pgp_message)
|
||||
if [ -n "$pgp_crypted" ]; then
|
||||
menu_pgp='\nDecrypt GPG'
|
||||
fi
|
||||
echo "$status_content"
|
||||
attachments=$(echo "$status" | jj -l 'media_attachments.#.remote_url' | delq)
|
||||
menuattachments=
|
||||
if [ -n "$attachments" ]; then
|
||||
echo "#EXTINF:-1, $uri" >> attachments.m3u8
|
||||
echo '[Attachments:]'
|
||||
menuattachments='\nMedia'
|
||||
echo "$attachments" | tee -a attachments.m3u8
|
||||
fi
|
||||
poll=$(echo "$status" | jj poll.id)
|
||||
if [ -n "$poll" ]; then
|
||||
echo '[Poll:]'
|
||||
echo "$(echo "$status" | jj -l 'poll.options.#.title')"
|
||||
fi
|
||||
|
||||
echo "$statuses_separator"
|
||||
if [ "$per_status_mode" = 'true' ]; then
|
||||
next=0
|
||||
force_stop=0
|
||||
while [ "$next" -eq 0 ]; do
|
||||
per_status_menu=$(echo "Next$menuattachments"$menu_pgp"\nFavorite$s_f_menu\nBookmark\nReply$edit_del_menu\nBack" | fzy)
|
||||
case "$per_status_menu" in
|
||||
"Next")
|
||||
next=1
|
||||
clear
|
||||
;;
|
||||
"Decrypt GPG") echo "$pgp_crypted" | gpg -d ;;
|
||||
"Media")
|
||||
for one_media in $attachments; do
|
||||
$default_media_player "$one_media"
|
||||
done
|
||||
;;
|
||||
"Share and favorite") share_and_favorite_mode "$id_status" ;;
|
||||
"Share") share_api_status "$id_status" ;;
|
||||
"Favorite") favorite_api_status "$id_status" ;;
|
||||
"Bookmark") bookmark_api_status "$id_status" ;;
|
||||
"Reply") reply_mode "$id_status" ;;
|
||||
"Edit") reply_mode "$id_status" '1' ;;
|
||||
"Delete") delete_api_status "$id_status" ;;
|
||||
"Back")
|
||||
next=1
|
||||
force_stop=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$force_stop" -eq 1 ]; then break; fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
statuses_view_menu()
|
||||
{
|
||||
sub_menu_lvl=2
|
||||
|
@ -594,42 +475,6 @@ statuses_view_menu()
|
|||
done
|
||||
}
|
||||
|
||||
thread_open()
|
||||
{
|
||||
echo 'Input id'
|
||||
read status_id
|
||||
thread_menu "$status_id"
|
||||
}
|
||||
|
||||
thread_menu()
|
||||
{
|
||||
sub_menu_lvl=2
|
||||
jsonthread=$(thread_api_statuses "$1")
|
||||
ancestors=$(echo "$jsonthread" | jj ancestors)
|
||||
descendants=$(echo "$jsonthread" | jj descendants)
|
||||
if [ '[]' != "$ancestors" ] && [ '[]' != "$descendants" ]; then
|
||||
jsonthread=$(echo "$ancestors""$descendants")
|
||||
elif [ '[]' != "$ancestors" ]; then
|
||||
jsonthread="$ancestors"
|
||||
else
|
||||
jsonthread="$descendants"
|
||||
fi
|
||||
while [ $sub_menu_lvl -eq 2 ]; do
|
||||
clear
|
||||
echo '[Thread]'
|
||||
ids_massive=$(echo "$jsonthread" | jj -l \#.id | delq)
|
||||
jsonmassive=$jsonthread
|
||||
statuses_render
|
||||
menuthread=$(echo 'Back\nReply\nShare\nFavorite\nShare and favorite' | fzy)
|
||||
case "$menuthread" in
|
||||
"Back") sub_menu_lvl=1 ;;
|
||||
"Reply") reply_mode ;;
|
||||
"Share") share_mode ;;
|
||||
"Favorite") favourite_mode ;;
|
||||
"Share and favorite") share_and_favorite_mode ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
timeline_api()
|
||||
{
|
||||
|
@ -658,45 +503,6 @@ search_api_statuses()
|
|||
timeline='search' timeline_menu
|
||||
}
|
||||
|
||||
timeline_menu()
|
||||
{
|
||||
json=$(timeline_api)
|
||||
sub_menu_lvl=1
|
||||
echo '#EXTM3U' > attachments.m3u8
|
||||
if [ "$per_status_mode" = 'true' ]; then
|
||||
menuentryes='Prev\nNext\nMain menu'
|
||||
else
|
||||
menuentryes='Prev\nNext\nReply\nShare\nFavorite\nShare and favorite\nThread\nMain menu'
|
||||
fi
|
||||
while [ $sub_menu_lvl -eq 1 ]; do
|
||||
ids_massive=$(echo "$json" | jj -l \#.id | delq)
|
||||
jsonmassive=$json
|
||||
statuses_render
|
||||
menu=$(echo "$menuentryes" | fzy)
|
||||
case $menu in
|
||||
"Prev")
|
||||
indexator=$(expr $(echo "$json" | jj \#) - 1)
|
||||
echo '#EXTM3U' > attachments.m3u8
|
||||
clear
|
||||
offset=$(echo "$json" | jj "$indexator".id)
|
||||
json=$(timeline_api "$offset")
|
||||
;;
|
||||
"Next")
|
||||
echo '#EXTM3U' > attachments.m3u8
|
||||
clear
|
||||
offset=$(echo "$json" | jj 0.id)
|
||||
json=$(timeline_api '' "$offset")
|
||||
;;
|
||||
"Reply") reply_mode ;;
|
||||
"Share") share_mode ;;
|
||||
"Favorite") favourite_mode ;;
|
||||
"Share and favorite") share_and_favorite_mode ;;
|
||||
"Thread") thread_open ;;
|
||||
"Main menu") sub_menu_lvl=0 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
reply_mode()
|
||||
{
|
||||
if [ -n "$1" ]; then
|
||||
|
|
Loading…
Reference in a new issue