Add option to allow toots with sensitive media to trend

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
Plastikmensch 2023-03-07 14:14:17 +01:00
parent dfbf96021e
commit 9c8f1925dc
No known key found for this signature in database
GPG Key ID: 96381D586F4A6077
5 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,7 @@ class Form::AdminSettings
trends_as_landing_page
trendable_by_default
trending_status_cw
trending_status_sensitive
show_domain_blocks
show_domain_blocks_rationale
noindex
@ -66,6 +67,7 @@ class Form::AdminSettings
trends_as_landing_page
trendable_by_default
trending_status_cw
trending_status_sensitive
noindex
require_invite_text
captcha_enabled

View File

@ -106,7 +106,7 @@ class Trends::Statuses < Trends::Base
private
def eligible?(status)
status.public_visibility? && status.account.discoverable? && !status.account.silenced? && !status.account.sensitized? && (status.spoiler_text.blank? || Setting.trending_status_cw) && !status.sensitive? && !status.reply? && valid_locale?(status.language)
status.public_visibility? && status.account.discoverable? && !status.account.silenced? && !status.account.sensitized? && (status.spoiler_text.blank? || Setting.trending_status_cw) && (!status.sensitive? || Setting.trending_status_sensitive) && !status.reply? && valid_locale?(status.language)
end
def calculate_scores(statuses, at_time)

View File

@ -24,6 +24,9 @@
.fields-group
= f.input :trending_status_cw, as: :boolean, wrapper: :with_label, label: t('admin.settings.trending_status_cw.title'), hint: t('admin.settings.trending_status_cw.desc_html'), glitch_only: true
.fields-group
= f.input :trending_status_sensitive, as: :boolean, wrapper: :with_label, label: t('admin.settings.trending_status_sensitive.title'), hint: t('admin.settings.trending_status_sensitive.desc_html'), glitch_only: true
%h4= t('admin.settings.discovery.public_timelines')
.fields-group

View File

@ -28,6 +28,9 @@ en:
trending_status_cw:
desc_html: When trending posts are enabled, allow posts with Content Warnings to be eligible. Changes to this setting are not retroactive.
title: Allow posts with Content Warnings to trend
trending_status_sensitive:
desc_html: When trending posts are enabled, allow posts with sensitive media to be eligible. Changes to this setting are not retroactive.
title: Allow posts with sensitive media to trend
appearance:
localization:
glitch_guide_link: https://crowdin.com/project/glitch-soc

View File

@ -22,6 +22,7 @@ defaults: &defaults
trends_as_landing_page: true
trendable_by_default: false
trending_status_cw: true
trending_status_sensitive: false
hide_followers_count: false
reserved_usernames:
- admin