mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-21 19:41:30 +00:00
Per 1 status mode implemented
This commit is contained in:
parent
251cc25b30
commit
02c1c0b912
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"instance": "soc.phreedom.club",
|
||||
"max_statuses": 40,
|
||||
"per_status_mode": false,
|
||||
"enabled_nsfw": false,
|
||||
"default_content_type": "text/markdown",
|
||||
"default_visibility": "unlisted",
|
||||
|
|
|
@ -15,6 +15,7 @@ statuses_separator=$(jj -i config.json statuses_separator)
|
|||
reversed_statuses=$(jj -i config.json reversed_statuses)
|
||||
quoting_reply=$(jj -i config.json quoting_reply)
|
||||
copy_mentions=$(jj -i config.json copy_mentions)
|
||||
per_status_mode=$(jj -i config.json per_status_mode)
|
||||
|
||||
#[AUTH SECTION]
|
||||
mkdir -m 711 -p .app_sessions
|
||||
|
@ -340,6 +341,7 @@ statuses_render()
|
|||
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
|
||||
|
@ -353,6 +355,27 @@ statuses_render()
|
|||
echo "$attachments" | tee -a attachments.m3u8
|
||||
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\nMedia\nShare and favorite\nShare\nFavorite\nReply\nBack' | fzy)
|
||||
case "$per_status_menu" in
|
||||
"Next") next=1; clear ;;
|
||||
"Media")
|
||||
for one_media in $attachments; do
|
||||
mpv "$one_media"
|
||||
done
|
||||
;;
|
||||
"Share and favorite") share_and_favorite_mode "$id_status" ;;
|
||||
"Share") share_api_status "$id_status" ;;
|
||||
"Favorite") favorite_api_status "$id_status" ;;
|
||||
"Reply") reply_mode "$id_status" ;;
|
||||
"Back") next=1; force_stop=1 ;;
|
||||
esac
|
||||
done
|
||||
if [ "$force_stop" -eq 1 ]; then break; fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -445,11 +468,16 @@ 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 'Prev\nNext\nReply\nShare\nFavorite\nShare and favorite\nThread\nMain menu' | fzy)
|
||||
menu=$(echo "$menuentryes" | fzy)
|
||||
case $menu in
|
||||
"Prev")
|
||||
indexator=$(expr $(echo "$json" | jj \#) - 1)
|
||||
|
@ -476,33 +504,44 @@ timeline_menu()
|
|||
|
||||
reply_mode()
|
||||
{
|
||||
echo 'Input id'
|
||||
read status_id
|
||||
reply_status=$(status_api_one "$status_id")
|
||||
if [ -n "$1" ]; then
|
||||
reply_status=$(status_api_one "$1")
|
||||
else
|
||||
echo 'Input id'
|
||||
read status_id
|
||||
reply_status=$(status_api_one "$status_id")
|
||||
fi
|
||||
if [ "$quoting_reply" = 'true' ]; then
|
||||
echo "$reply_status" | jj content | html_to_txt_render | sed 's/^/> /' > tmp_status.md
|
||||
fi
|
||||
if [ "$copy_mentions" = 'true' ]; then
|
||||
mentions_reply=$(echo "$reply_status" | jj -l 'mentions.#.acct' | delq | legacy_addr_preprocess | tr '\n' ',' | sed 's/,$//g')
|
||||
fi
|
||||
write_status_menu "$status_id"
|
||||
write_status_menu "$(echo "$reply_status" | jj id)"
|
||||
}
|
||||
|
||||
share_and_favorite_mode()
|
||||
{
|
||||
echo 'Input id (s - stop)'
|
||||
shareandfavmode=1
|
||||
while [ $shareandfavmode -eq 1 ]; do
|
||||
read status_id
|
||||
if [ "$status_id" = 's' ]; then
|
||||
shareandfavmode=0
|
||||
else
|
||||
share_api_status "$status_id"
|
||||
echo "$http_code"
|
||||
favorite_api_status "$status_id"
|
||||
echo "$http_code"
|
||||
fi
|
||||
done
|
||||
if [ -n "$1" ]; then
|
||||
share_api_status "$1"
|
||||
echo "$http_code"
|
||||
favorite_api_status "$1"
|
||||
echo "$http_code"
|
||||
else
|
||||
echo 'Input id (s - stop)'
|
||||
shareandfavmode=1
|
||||
while [ $shareandfavmode -eq 1 ]; do
|
||||
read status_id
|
||||
if [ "$status_id" = 's' ]; then
|
||||
shareandfavmode=0
|
||||
else
|
||||
share_api_status "$status_id"
|
||||
echo "$http_code"
|
||||
favorite_api_status "$status_id"
|
||||
echo "$http_code"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
share_api_status()
|
||||
|
|
Loading…
Reference in a new issue