NSFW only show statuses filter added

This commit is contained in:
localhost_frssoft 2022-05-04 22:20:40 +03:00
parent 902b5a40b2
commit 0c9593e961
2 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@
"max_statuses": 40,
"per_status_mode": false,
"enabled_nsfw": true,
"nsfw_only": false,
"hide_reblogs": false,
"default_content_type": "text/plain",
"default_visibility": "unlisted",

View file

@ -28,6 +28,7 @@ instance_point="$default_connect_protocol://$instance/api/v1"
instance_point_pleroma="$default_connect_protocol://$instance/api/pleroma"
instance_hist='instance.hist'
enabled_nsfw=$(jj -i config.json enabled_nsfw)
nsfw_only=$(jj -i config.json nsfw_only)
hide_reblogs=$(jj -i config.json hide_reblogs)
max_statuses=$(jj -i config.json max_statuses)
default_visibility=$(jj -i config.json default_visibility)
@ -405,10 +406,15 @@ statuses_render()
if [ "$hide_reblogs" = 'true' ] && [ -n "$reblog" ]; then
continue
fi
sensitive=$(echo "$status" | jj sensitive)
if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then
continue
fi
if [ "$nsfw_only" = 'true' ] && [ "$sensitive" = 'false' ]; then
continue
fi
whoacct=$(echo "$status" | jj account.acct)
reblogacct=$(echo "$status" | jj reblog.account.acct)
uri=$(echo "$status" | jj uri)