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, "max_statuses": 40,
"per_status_mode": false, "per_status_mode": false,
"enabled_nsfw": true, "enabled_nsfw": true,
"nsfw_only": false,
"hide_reblogs": false, "hide_reblogs": false,
"default_content_type": "text/plain", "default_content_type": "text/plain",
"default_visibility": "unlisted", "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_point_pleroma="$default_connect_protocol://$instance/api/pleroma"
instance_hist='instance.hist' instance_hist='instance.hist'
enabled_nsfw=$(jj -i config.json enabled_nsfw) enabled_nsfw=$(jj -i config.json enabled_nsfw)
nsfw_only=$(jj -i config.json nsfw_only)
hide_reblogs=$(jj -i config.json hide_reblogs) hide_reblogs=$(jj -i config.json hide_reblogs)
max_statuses=$(jj -i config.json max_statuses) max_statuses=$(jj -i config.json max_statuses)
default_visibility=$(jj -i config.json default_visibility) default_visibility=$(jj -i config.json default_visibility)
@ -405,10 +406,15 @@ statuses_render()
if [ "$hide_reblogs" = 'true' ] && [ -n "$reblog" ]; then if [ "$hide_reblogs" = 'true' ] && [ -n "$reblog" ]; then
continue continue
fi fi
sensitive=$(echo "$status" | jj sensitive) sensitive=$(echo "$status" | jj sensitive)
if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then
continue continue
fi fi
if [ "$nsfw_only" = 'true' ] && [ "$sensitive" = 'false' ]; then
continue
fi
whoacct=$(echo "$status" | jj account.acct) whoacct=$(echo "$status" | jj account.acct)
reblogacct=$(echo "$status" | jj reblog.account.acct) reblogacct=$(echo "$status" | jj reblog.account.acct)
uri=$(echo "$status" | jj uri) uri=$(echo "$status" | jj uri)