diff --git a/config.json b/config.json index cd257b5..ea27178 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "instance": "soc.phreedom.club", "max_statuses": 40, "per_status_mode": false, - "enabled_nsfw": false, + "enabled_nsfw": true, "hide_reblogs": false, "default_content_type": "text/markdown", "default_visibility": "unlisted", diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 0089d29..272f238 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -317,10 +317,6 @@ 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 @@ -330,6 +326,10 @@ 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 whoacct=$(echo "$status" | jj account.acct) reblogacct=$(echo "$status" | jj reblog.account.acct) uri=$(echo "$status" | jj uri) @@ -350,6 +350,9 @@ statuses_render() if [ -n "$spoiler_text" ]; then echo "#[$spoiler_text]" fi + if [ "$sensitive" = 'true' ]; then + echo '[NSFW]' + fi echo "$status" | jj -r content | delqse | html_to_txt_render attachments=$(echo "$status" | jj -l media_attachments.#.remote_url | delq) if [ -n "$attachments" ]; then