mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-24 10:31:28 +00:00
Added manage followings function: add and delete
This commit is contained in:
parent
bfdce6ecf0
commit
eeb88482f6
|
@ -301,7 +301,10 @@ followings_menu()
|
|||
"Next") offset=$(echo "$followings" | jj $(expr $(echo "$followings" | jj \#) - 1).id) ;;
|
||||
*)
|
||||
index=$(echo "$choice" | cut -f 1 -d:)
|
||||
statuses_view_menu "$(echo "$followings" | jj "$index".acct)"
|
||||
case "$1" in
|
||||
'Remove following') unfollow_account "$(echo "$followings" | jj "$index".id)" ;;
|
||||
'') statuses_view_menu "$(echo "$followings" | jj "$index".acct)" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
@ -322,6 +325,17 @@ reject_follow_request()
|
|||
post_request "$instance_point/follow_requests/$1/reject"
|
||||
}
|
||||
|
||||
follow_account()
|
||||
{
|
||||
acct_id=$(account_api_get "$1" | jj id)
|
||||
post_request "$instance_point/accounts/$acct_id/follow"
|
||||
}
|
||||
|
||||
unfollow_account()
|
||||
{
|
||||
post_request "$instance_point/accounts/$1/unfollow"
|
||||
}
|
||||
|
||||
menu_follow_requests()
|
||||
{
|
||||
follow_req=$(following_requests)
|
||||
|
@ -385,6 +399,11 @@ delqse()
|
|||
sed 's/^"//g; s/"$//g'
|
||||
}
|
||||
|
||||
account_api_get()
|
||||
{
|
||||
default_curl_opt "$instance_point/accounts/$1"
|
||||
}
|
||||
|
||||
statuses_api_account()
|
||||
{
|
||||
default_curl_opt "$instance_point/accounts/$1/statuses?limit=$max_statuses&max_id=$2&min_id=$3"
|
||||
|
@ -853,11 +872,12 @@ notif_api_remove_all()
|
|||
menu_write_status='Write status'
|
||||
menu_timeline='Timelines'
|
||||
notif='Notifications'
|
||||
my_account='Account'
|
||||
followingsmenu='Followings'
|
||||
followrequests='Follow requests'
|
||||
my_account='Account'
|
||||
authmake='Auth'
|
||||
backup_restore='Backup/Restore'
|
||||
manage_followings='Manage followings'
|
||||
authmake='Auth'
|
||||
switchinstance='Switch instance'
|
||||
Exit='Exit'
|
||||
|
||||
|
@ -875,10 +895,20 @@ while true; do
|
|||
;;
|
||||
"$notif") notif_menu ;;
|
||||
"$my_account")
|
||||
my_account_menu=$(echo "$followingsmenu\n$followrequests\n$backup_restore" | fzy)
|
||||
my_account_menu=$(echo "$followingsmenu\n$followrequests\n$manage_followings\n$backup_restore" | fzy)
|
||||
case $my_account_menu in
|
||||
"$followingsmenu") followings_menu ;;
|
||||
"$followrequests") menu_follow_requests ;;
|
||||
"$manage_followings")
|
||||
action_manage=$(echo 'Add following\nRemove following' | fzy)
|
||||
if [ "$action_manage" = 'Add following' ]; then
|
||||
echo 'Input nick or full address (ex. example_nick or example@domain'
|
||||
read add_account
|
||||
follow_account "$add_account"
|
||||
else
|
||||
followings_menu "$action_manage"
|
||||
fi
|
||||
;;
|
||||
"$backup_restore") backup_restore_menu ;;
|
||||
esac
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue