diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb index 493fe4776a5c19..220b31b36a4ef8 100644 --- a/app/controllers/api/v1/timelines/public_controller.rb +++ b/app/controllers/api/v1/timelines/public_controller.rb @@ -39,8 +39,8 @@ def public_feed 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 diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index b53a82db22b818..cdded82a061f76 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -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 diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 8e74e152ed7d36..c7efbe05daaa51 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -129,14 +129,19 @@ def broadcast_to_hashtag_streams! end def broadcast_to_public_streams! - return if @status.reply? && @status.in_reply_to_account_id != @account.id && !Setting.show_replies_in_public_timelines - - redis.publish('timeline:public', anonymous_payload) - redis.publish(@status.local? ? 'timeline:public:local' : 'timeline:public:remote', anonymous_payload) + broadcast_to = ->(channel) { + redis.publish(channel, anonymous_payload) + if @status.with_media? + redis.publish("#{channel}:media") + end + } + is_reply = @status.reply? && @status.in_reply_to_account_id != @account.id - 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 diff --git a/app/views/admin/settings/other/show.html.haml b/app/views/admin/settings/other/show.html.haml index 1a7a4e46e54b16..ba201cbdac9233 100644 --- a/app/views/admin/settings/other/show.html.haml +++ b/app/views/admin/settings/other/show.html.haml @@ -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 diff --git a/config/locales-glitch/en.yml b/config/locales-glitch/en.yml index e60a89e1898b78..a5b6083f0060a4 100644 --- a/config/locales-glitch/en.yml +++ b/config/locales-glitch/en.yml @@ -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