From 6609a6d1692d053d50c2916bb715936a34bd71fa Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Thu, 5 May 2022 02:28:40 +0300 Subject: [PATCH] Detect nsfw reblogs --- pleroma-cli.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 3a5bae4..5045bbf 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -408,11 +408,22 @@ statuses_render() fi sensitive=$(echo "$status" | jj sensitive) - if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then - continue - fi - if [ "$nsfw_only" = 'true' ] && [ "$sensitive" = 'false' ]; then - continue + sensitive_reblog=$(echo "$status" | jj reblog.sensitive) + + if [ -n "$reblog" ]; then + if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive_reblog" = 'true' ]; then + continue + fi + if [ "$nsfw_only" = 'true' ] && [ "$sensitive_reblog" = 'false' ]; then + continue + fi + else + if [ "$enabled_nsfw" = 'false' ] && [ "$sensitive" = 'true' ]; then + continue + fi + if [ "$nsfw_only" = 'true' ] && [ "$sensitive" = 'false' ]; then + continue + fi fi whoacct=$(echo "$status" | jj account.acct) @@ -439,7 +450,7 @@ statuses_render() if [ -n "$spoiler_text" ]; then echo "#[$spoiler_text]" fi - if [ "$sensitive" = 'true' ]; then + if [ "$sensitive" = 'true' -o "$sensitive_reblog" = 'true' ]; then echo '[NSFW]' fi echo "$status" | jj -r content | delqse | html_to_txt_render