mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-21 22:51:28 +00:00
Added NSFW statuses filter
This commit is contained in:
parent
e928d6f23a
commit
27c3bb40a3
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"instance": "soc.phreedom.club",
|
||||
"max_statuses": 40,
|
||||
"enabled_nsfw": false,
|
||||
"default_content_type": "text/markdown",
|
||||
"default_visibility": "unlisted",
|
||||
"format_time": "+%d.%m.%Y %H:%M:%S",
|
||||
|
|
|
@ -5,6 +5,7 @@ alias default_auth_browser=links
|
|||
instance_point="https://$instance/api/v1"
|
||||
instance_point_pleroma="https://$instance/api/pleroma"
|
||||
instance_hist='instance.hist'
|
||||
enabled_nsfw=$(jj -i config.json enabled_nsfw)
|
||||
max_statuses=$(jj -i config.json max_statuses)
|
||||
default_visibility=$(jj -i config.json default_visibility)
|
||||
default_content_type=$(jj -i config.json default_content_type)
|
||||
|
@ -312,11 +313,16 @@ status_api_one()
|
|||
|
||||
statuses_render()
|
||||
{
|
||||
if [ "$enabled_nsfw" = 'false' ]; then
|
||||
ids_massive=$(echo "$jsonmassive" | jj -l '#[sensitive=false]#.id' | delq)
|
||||
jsonmassive=$(echo "$jsonmassive" | jj '#[sensitive=false]#')
|
||||
fi
|
||||
if [ "$reversed_statuses" = 'true' ]; then
|
||||
ids_massive=$(echo $ids_massive | tr ' ' '\n' | tac | tr '\n' ' ')
|
||||
fi
|
||||
for i in $ids_massive; do
|
||||
status=$(echo "$jsonmassive" | jj "#[id=$i]")
|
||||
|
||||
reblog=$(echo $status | jj reblog.id)
|
||||
uri=$(echo $status | jj uri)
|
||||
id_status=$(echo $status | jj id)
|
||||
|
|
Loading…
Reference in a new issue