Compare commits

..

2 commits

View file

@ -467,7 +467,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"$s_f_menu"\nFavorite\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=1; clear ;; "Next") next=1; clear ;;
"Media") "Media")
@ -478,6 +478,7 @@ statuses_render()
"Share and favorite") share_and_favorite_mode "$id_status" ;; "Share and favorite") share_and_favorite_mode "$id_status" ;;
"Share") share_api_status "$id_status" ;; "Share") share_api_status "$id_status" ;;
"Favorite") favorite_api_status "$id_status" ;; "Favorite") favorite_api_status "$id_status" ;;
"Bookmark") bookmark_api_status "$id_status" ;;
"Reply") reply_mode "$id_status" ;; "Reply") reply_mode "$id_status" ;;
"Back") next=1; force_stop=1 ;; "Back") next=1; force_stop=1 ;;
esac esac
@ -565,6 +566,7 @@ timeline_api()
"home") default_curl_opt "$instance_point/timelines/home?limit=$max_statuses&max_id=$1&min_id=$2" ;; "home") default_curl_opt "$instance_point/timelines/home?limit=$max_statuses&max_id=$1&min_id=$2" ;;
"home/local") default_curl_opt "$instance_point/timelines/home?local=true&limit=$max_statuses&max_id=$1&min_id=$2" ;; "home/local") default_curl_opt "$instance_point/timelines/home?local=true&limit=$max_statuses&max_id=$1&min_id=$2" ;;
"favourites") default_curl_opt "$instance_point/favourites?limit=$max_statuses&max_id=$1&min_id=$2" ;; "favourites") default_curl_opt "$instance_point/favourites?limit=$max_statuses&max_id=$1&min_id=$2" ;;
"bookmarks") default_curl_opt "$instance_point/bookmarks?limit=$max_statuses&max_id=$1&min_id=$2" ;;
"direct") default_curl_opt "$instance_point/timelines/direct?limit=$max_statuses&max_id=$1&min_id=$2" ;; "direct") default_curl_opt "$instance_point/timelines/direct?limit=$max_statuses&max_id=$1&min_id=$2" ;;
"public") default_curl_opt "$instance_point/timelines/public?limit=$max_statuses&max_id=$1&min_id=$2" ;; "public") default_curl_opt "$instance_point/timelines/public?limit=$max_statuses&max_id=$1&min_id=$2" ;;
"local") default_curl_opt "$instance_point/timelines/public?local=true&limit=$max_statuses&max_id=$1&min_id=$2" ;; "local") default_curl_opt "$instance_point/timelines/public?local=true&limit=$max_statuses&max_id=$1&min_id=$2" ;;
@ -695,6 +697,13 @@ favourite_mode()
done done
} }
bookmark_api_status()
{
mkdir -p -m 711 bookmarks/"$instance"
post_request "$instance_point/statuses/$1/bookmark" | jj -p -o "bookmarks/$instance/$1"
chmod 600 "bookmarks/$instance/$1"
}
write_api_status() write_api_status()
{ {
if [ -n "$mediaattach" ]; then if [ -n "$mediaattach" ]; then
@ -840,6 +849,7 @@ menu_timeline='Timelines'
notif='Notifications' notif='Notifications'
followingsmenu='Followings' followingsmenu='Followings'
followrequests='Follow requests' followrequests='Follow requests'
my_account='Account'
authmake='Auth' authmake='Auth'
backup_restore='Backup/Restore' backup_restore='Backup/Restore'
switchinstance='Switch instance' switchinstance='Switch instance'
@ -847,20 +857,26 @@ Exit='Exit'
while true; do while true; do
if [ -n "$auth" ]; then if [ -n "$auth" ]; then
main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$followingsmenu\n$followrequests\n$backup_restore\n$switchinstance\n$Exit" | fzy) main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$my_account\n$switchinstance\n$Exit" | fzy)
else else
main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy) main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy)
fi fi
case $main_menu in case $main_menu in
"$menu_write_status") write_status_menu ;; "$menu_write_status") write_status_menu ;;
"$menu_timeline") "$menu_timeline")
timeline=$(echo 'home\nhome/local\nfavourites\ndirect\nlocal\npublic' | fzy) timeline=$(echo 'home\nhome/local\nfavourites\nbookmarks\ndirect\nlocal\npublic' | fzy)
timeline_menu timeline_menu
;; ;;
"$notif") notif_menu ;; "$notif") notif_menu ;;
"$followingsmenu") followings_menu ;; "$my_account")
"$followrequests") menu_follow_requests ;; my_account_menu=$(echo "$followingsmenu\n$followrequests\n$backup_restore" | fzy)
"$backup_restore") backup_restore_menu ;; case $my_account_menu in
"$followingsmenu") followings_menu ;;
"$followrequests") menu_follow_requests ;;
"$backup_restore") backup_restore_menu ;;
esac
;;
"$switchinstance") "$switchinstance")
empty=0 empty=0
case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in