Add the nsfw removal behind a config switch
This commit is contained in:
parent
858fd127a1
commit
6352aa112b
2 changed files with 5 additions and 3 deletions
|
@ -87,6 +87,7 @@ Example: To set the automatic database cleanup process add this line to your .ht
|
||||||
* **relay_server_tags** - Comma separated list of tags for the "tags" subscription (see "relay_scrope")
|
* **relay_server_tags** - Comma separated list of tags for the "tags" subscription (see "relay_scrope")
|
||||||
* **relay_user_tags** (Boolean) - If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".
|
* **relay_user_tags** (Boolean) - If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".
|
||||||
* **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one.
|
* **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one.
|
||||||
|
* **remove_nsfw_with_cw** (Boolean) - If enabled, the "nsfw" will be removed from Mastodon posts with content warning.
|
||||||
* **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones.
|
* **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones.
|
||||||
* **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones.
|
* **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones.
|
||||||
* **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.
|
* **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.
|
||||||
|
|
|
@ -679,9 +679,10 @@ class OStatus
|
||||||
foreach ($category->attributes as $attributes) {
|
foreach ($category->attributes as $attributes) {
|
||||||
if ($attributes->name == "term") {
|
if ($attributes->name == "term") {
|
||||||
$term = $attributes->textContent;
|
$term = $attributes->textContent;
|
||||||
// don't add nsfw with content warning
|
// don't add nsfw with content warning if enabled.
|
||||||
// Background: "nsfw" is set automatically by Mastodon and superfluous
|
// Background: "nsfw" is set automatically by Mastodon
|
||||||
if (!$content_warning || ($term != 'nsfw')) {
|
if (!Config::get('system', 'remove_nsfw_with_cw', false) ||
|
||||||
|
!$content_warning || ($term != 'nsfw')) {
|
||||||
if (strlen($item["tag"])) {
|
if (strlen($item["tag"])) {
|
||||||
$item["tag"] .= ',';
|
$item["tag"] .= ',';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue