Compare commits
7 commits
newmain
...
split_publ
Author | SHA1 | Date | |
---|---|---|---|
109ccf9f60 | |||
80cc050e02 | |||
4794789f3d | |||
874d68fedf | |||
a6b4f5217c | |||
78d412c931 | |||
fe2acbc4c4 |
|
@ -39,8 +39,8 @@ class Api::V1::Timelines::PublicController < Api::BaseController
|
|||
remote: truthy_param?(:remote),
|
||||
only_media: truthy_param?(:only_media),
|
||||
allow_local_only: truthy_param?(:allow_local_only),
|
||||
with_replies: Setting.show_replies_in_public_timelines,
|
||||
with_reblogs: Setting.show_reblogs_in_public_timelines,
|
||||
with_replies: truthy_param?(:local) ? Setting.show_replies_in_local_timelines : Setting.show_replies_in_federated_timelines,
|
||||
with_reblogs: truthy_param?(:local) ? Setting.show_reblogs_in_local_timelines : Setting.show_reblogs_in_federated_timelines,
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@ class Form::AdminSettings
|
|||
flavour_and_skin
|
||||
thumbnail
|
||||
mascot
|
||||
show_reblogs_in_public_timelines
|
||||
show_replies_in_public_timelines
|
||||
show_reblogs_in_local_timelines
|
||||
show_replies_in_local_timelines
|
||||
show_reblogs_in_federated_timelines
|
||||
show_replies_in_federated_timelines
|
||||
trends
|
||||
trendable_by_default
|
||||
trending_status_cw
|
||||
|
@ -54,8 +56,10 @@ class Form::AdminSettings
|
|||
preview_sensitive_media
|
||||
profile_directory
|
||||
hide_followers_count
|
||||
show_reblogs_in_public_timelines
|
||||
show_replies_in_public_timelines
|
||||
show_reblogs_in_local_timelines
|
||||
show_replies_in_local_timelines
|
||||
show_reblogs_in_federated_timelines
|
||||
show_replies_in_federated_timelines
|
||||
trends
|
||||
trendable_by_default
|
||||
trending_status_cw
|
||||
|
|
|
@ -129,14 +129,17 @@ class FanOutOnWriteService < BaseService
|
|||
end
|
||||
|
||||
def broadcast_to_public_streams!
|
||||
return if @status.reply? && @status.in_reply_to_account_id != @account.id && !Setting.show_replies_in_public_timelines
|
||||
broadcast_to = ->(channel) {
|
||||
redis.publish(channel, anonymous_payload)
|
||||
redis.publish("#{channel}:media", anonymous_payload) if @status.with_media?
|
||||
}
|
||||
is_reply = @status.reply? && @status.in_reply_to_account_id != @account.id
|
||||
|
||||
redis.publish('timeline:public', anonymous_payload)
|
||||
redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload)
|
||||
|
||||
if @status.with_media?
|
||||
redis.publish('timeline:public:media', anonymous_payload)
|
||||
redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', anonymous_payload)
|
||||
broadcast_to.call('timeline:public') if !is_reply || Setting.show_replies_in_federated_timelines
|
||||
if @status.local
|
||||
broadcast_to.call('timeline:public:local') if !is_reply || Setting.show_replies_in_local_timelines
|
||||
else
|
||||
broadcast_to.call('timeline:public:remote') if !is_reply || Setting.show_replies_in_federated_timelines
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -14,10 +14,16 @@
|
|||
= f.input :hide_followers_count, as: :boolean, wrapper: :with_label, label: t('admin.settings.hide_followers_count.title'), hint: t('admin.settings.hide_followers_count.desc_html'), glitch_only: true
|
||||
|
||||
.fields-group
|
||||
= f.input :show_reblogs_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_public_timelines.title'), hint: t('admin.settings.show_reblogs_in_public_timelines.desc_html'), glitch_only: true
|
||||
= f.input :show_reblogs_in_local_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_local_timelines.title'), hint: t('admin.settings.show_reblogs_in_local_timelines.desc_html'), glitch_only: true
|
||||
|
||||
.fields-group
|
||||
= f.input :show_replies_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_public_timelines.title'), hint: t('admin.settings.show_replies_in_public_timelines.desc_html'), glitch_only: true
|
||||
= f.input :show_replies_in_local_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_local_timelines.title'), hint: t('admin.settings.show_replies_in_local_timelines.desc_html'), glitch_only: true
|
||||
|
||||
.fields-group
|
||||
= f.input :show_reblogs_in_federated_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_federated_timelines.title'), hint: t('admin.settings.show_reblogs_in_federated_timelines.desc_html'), glitch_only: true
|
||||
|
||||
.fields-group
|
||||
= f.input :show_replies_in_federated_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_federated_timelines.title'), hint: t('admin.settings.show_replies_in_federated_timelines.desc_html'), glitch_only: true
|
||||
|
||||
.fields-group
|
||||
= f.input :outgoing_spoilers, wrapper: :with_label, label: t('admin.settings.outgoing_spoilers.title'), hint: t('admin.settings.outgoing_spoilers.desc_html'), glitch_only: true
|
||||
|
|
|
@ -19,12 +19,18 @@ en:
|
|||
outgoing_spoilers:
|
||||
desc_html: When federating toots, add this content warning to toots that do not have one. It is useful if your server is specialized in content other servers might want to have under a Content Warning. Media will also be marked as sensitive.
|
||||
title: Content warning for outgoing toots
|
||||
show_reblogs_in_public_timelines:
|
||||
desc_html: Show public boosts of public toots in local and public timelines.
|
||||
title: Show boosts in public timelines
|
||||
show_replies_in_public_timelines:
|
||||
desc_html: In addition to public self-replies (threads), show public replies in local and public timelines.
|
||||
title: Show replies in public timelines
|
||||
show_reblogs_in_federated_timelines:
|
||||
desc_html: Show public boosts of public toots in the federated timeline.
|
||||
title: Show boosts in the federated timeline
|
||||
show_reblogs_in_local_timelines:
|
||||
desc_html: Show public boosts in the instance's local timeline.
|
||||
title: Show boosts in the local timeline
|
||||
show_replies_in_federated_timelines:
|
||||
desc_html: In addition to public self-replies (threads), show public replies in the federated timeline.
|
||||
title: Show replies in the federated timeline
|
||||
show_replies_in_local_timelines:
|
||||
desc_html: In addition to public self-replies (threads), show public replies in the instance's local timeline.
|
||||
title: Show replies in the local timeline
|
||||
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
|
||||
|
|
|
@ -73,8 +73,10 @@ defaults: &defaults
|
|||
bootstrap_timeline_accounts: ''
|
||||
activity_api_enabled: true
|
||||
peers_api_enabled: true
|
||||
show_reblogs_in_public_timelines: false
|
||||
show_replies_in_public_timelines: false
|
||||
show_reblogs_in_local_timelines: false
|
||||
show_reblogs_in_federated_timelines: false
|
||||
show_replies_in_local_timelines: false
|
||||
show_replies_in_federated_timelines: false
|
||||
default_content_type: 'text/plain'
|
||||
show_domain_blocks: 'disabled'
|
||||
show_domain_blocks_rationale: 'disabled'
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
class MigrateShowReblogsRepliesInPublicTimelinesSetting < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
show_reblogs_in_public_timelines = Setting.find_by(var: 'show_reblogs_in_public_timelines')
|
||||
if show_reblogs_in_public_timelines.nil? || show_reblogs_in_public_timelines.value
|
||||
setting_local = Setting.where(var: 'show_reblogs_in_local_timelines').first_or_initialize(var: 'show_reblogs_in_local_timelines')
|
||||
setting_federated = Setting.where(var: 'show_reblogs_in_federated_timelines').first_or_initialize(var: 'show_reblogs_in_federated_timelines')
|
||||
setting_local.update(value: true)
|
||||
setting_federated.update(value: true)
|
||||
end
|
||||
|
||||
show_replies_in_public_timelines = Setting.find_by(var: 'show_replies_in_public_timelines')
|
||||
if show_replies_in_public_timelines.nil? || show_replies_in_public_timelines.value
|
||||
setting_local = Setting.where(var: 'show_replies_in_local_timelines').first_or_initialize(var: 'show_replies_in_local_timelines')
|
||||
setting_federated = Setting.where(var: 'show_replies_in_federated_timelines').first_or_initialize(var: 'show_replies_in_federated_timelines')
|
||||
setting_local.update(value: true)
|
||||
setting_federated.update(value: true)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
show_reblogs_in_local_timelines = Setting.find_by(var: 'show_reblogs_in_local_timelines')
|
||||
show_reblogs_in_federate_timelines = Setting.find_by(var: 'show_reblogs_in_federated_timelines')
|
||||
if show_reblogs_in_local_timelines.nil? || show_reblogs_in_local_timelines.value || show_reblogs_in_federated_timelines.nil? || show_reblogs_in_federated_timelines.value
|
||||
setting = Setting.where(var: 'show_reblogs_in_public_timelines').first_or_initialize(var: 'show_reblogs_in_public_timelines')
|
||||
setting.update(value: true)
|
||||
end
|
||||
|
||||
show_replies_in_public_timelines = Setting.find_by(var: 'show_replies_in_public_timelines')
|
||||
if show_replies_in_local_timelines.nil? || show_replies_in_local_timelines.value || show_replies_in_federated_timelines.nil? || show_replies_in_federated_timelines.value
|
||||
setting = Setting.where(var: 'show_replies_in_public_timelines').first_or_initialize(var: 'show_replies_in_public_timelines')
|
||||
setting.update(value: true)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue