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