diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/form/admin_settings.rb | 4 | ||||
-rw-r--r-- | app/models/status.rb | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index f81776346..0e9bfb265 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -32,6 +32,8 @@ class Form::AdminSettings thumbnail hero mascot + show_reblogs_in_public_timelines + show_replies_in_public_timelines ).freeze BOOLEAN_KEYS = %i( @@ -45,6 +47,8 @@ class Form::AdminSettings profile_directory hide_followers_count enable_keybase + show_reblogs_in_public_timelines + show_replies_in_public_timelines ).freeze UPLOAD_KEYS = %i( diff --git a/app/models/status.rb b/app/models/status.rb index e7fa0220b..1b905d5b8 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -327,7 +327,8 @@ class Status < ApplicationRecord end def as_public_timeline(account = nil, local_only = false) - query = timeline_scope(local_only).without_replies + query = timeline_scope(local_only) + query = query.without_replies unless Setting.show_replies_in_public_timelines apply_timeline_filters(query, account, local_only) end @@ -408,9 +409,12 @@ class Status < ApplicationRecord def timeline_scope(local_only = false) starting_scope = local_only ? Status.local : Status - starting_scope - .with_public_visibility - .without_reblogs + starting_scope = starting_scope.with_public_visibility + if Setting.show_reblogs_in_public_timelines + starting_scope + else + starting_scope.without_reblogs + end end def apply_timeline_filters(query, account, local_only) |