diff --git a/config.json b/config.json index e0f3bc6..fd52a27 100644 --- a/config.json +++ b/config.json @@ -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", diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 79d3235..22d0575 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -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)