Compare commits

...

2 commits

View file

@ -282,10 +282,10 @@ following_requests()
accept_follow_request() accept_follow_request()
{ {
post_request "$instance_point/follow_requests/$1/authorize" post_request "$instance_point/follow_requests/$1/authorize"
} }
reject_follow_requests() reject_follow_request()
{ {
post_request "$instance_point/follow_requests/$1/reject" post_request "$instance_point/follow_requests/$1/reject"
} }
@ -297,24 +297,27 @@ menu_follow_requests()
ids=$(echo "$follow_req" | jj -l \#.id | delq) ids=$(echo "$follow_req" | jj -l \#.id | delq)
clear clear
echo "Follow requests: $count" echo "Follow requests: $count"
for i in $ids; do for id in $ids; do
whoacct=$(echo "$follow_req" | jj "#[id=$i].acct") whoacct=$(echo "$follow_req" | jj "#[id=$id].acct")
datecreate=$(echo "$follow_req" | jj "#[id=$i].created_at") datecreate=$(echo "$follow_req" | jj "#[id=$id].created_at")
acct_display=$(echo "$follow_req" | jj "#[id=$i].display_name") acct_display=$(echo "$follow_req" | jj "#[id=$id].display_name")
acct_bot=$(echo "$follow_req" | jj "#[id=$i].bot") acct_bot=$(echo "$follow_req" | jj "#[id=$id].bot")
note=$(echo "$follow_req" | jj "#[id=$i].note" | html_to_txt_render) note=$(echo "$follow_req" | jj "#[id=$id].note" | html_to_txt_render)
echo "$acct_display $whoacct" echo "$acct_display $whoacct"
echo "Account creation date: $(date -d "$datecreate" "$format_time")" echo "Account creation date: $(date -d "$datecreate" "$format_time")"
echo "Bot: $acct_bot" echo "Bot: $acct_bot"
echo "Note:\n $note" echo "Note:\n $note"
choice=$(echo 'Accept\nReject\nShow statuses\nNothing' | fzy) nonexit=1
case "$choice" in while [ "$nonexit" -eq 1 ]; do
"Accept") accept_follow_request "$i" ;; choice=$(echo 'Accept\nReject\nShow statuses\nNothing' | fzy)
"Reject") reject_follow_request "$i" ;; case "$choice" in
"Show statuses") statuses_view_menu "$whoacct" ;; "Accept") accept_follow_request "$id" && nonexit=0 ;;
"Nothing") echo ;; "Reject") reject_follow_request "$id" && nonexit=0 ;;
esac "Show statuses") statuses_view_menu "$whoacct" ;;
"Nothing") nonexit=0 ;;
esac
done
clear clear
done done