2023-06-19 02:06:49 +10:00
|
|
|
pendcount()
|
|
|
|
{
|
2024-07-02 14:51:50 +10:00
|
|
|
get "admin/registration_application/count" ".registration_applications"
|
2023-06-19 02:06:49 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
pending()
|
|
|
|
{
|
2024-07-02 14:51:50 +10:00
|
|
|
applications=$(get "admin/registration_application/list" ".registration_applications" "unread_only=true")
|
2023-06-19 02:06:49 +10:00
|
|
|
i=0
|
2024-07-02 14:51:50 +10:00
|
|
|
app=$(jq ".[$i] // empty" <<< "$applications")
|
2023-06-19 02:06:49 +10:00
|
|
|
while [ -n "$app" ]; do
|
|
|
|
appid=$(jq -r .registration_application.id <<< "$app")
|
|
|
|
jq '.registration_application.id, (.creator | .name,.published,.bio,"bot: "+.bot_account,"matrix: "+.matrix_user_id,.avatar,.banner), "captcha: "+.registration_application.answer' <<< "$app"
|
|
|
|
ans= # Better make sure this resets lol
|
|
|
|
while [ ! ans = 'y' -a ! ans = 'n' -a ! ans = 's' ]; do
|
|
|
|
namedget ans "Accept? (y)es (n)o (s)kip"
|
|
|
|
done
|
|
|
|
case $ans in
|
2023-07-02 19:28:33 +10:00
|
|
|
y) put "admin/registration_application/approve" '{"id":'$appid',"approve":true}';;
|
|
|
|
n) namedget rejected "Why not?" true; put "admin/registration_application/approve" '{"id":'$appid',"deny_reason":"'$rejected'","approve":false}';;
|
2023-06-19 02:06:49 +10:00
|
|
|
esac
|
|
|
|
done
|
2023-09-20 04:26:15 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
addadmin(){ echo "stub"; }
|
2024-07-02 14:51:50 +10:00
|
|
|
remadmin(){ echo "stub"; }
|