diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/status.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index fab3644a4..ade8b4c85 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -133,6 +133,8 @@ class Status < ApplicationRecord scope :unpublished, -> { rewhere(published: false) } scope :published, -> { where(published: true) } scope :without_semiprivate, -> { where(semiprivate: false) } + scope :reblogs, -> { where('statuses.reblog_of_id IS NOT NULL') } + scope :locally_reblogged, -> { where(id: Status.unscoped.local.reblogs.select(:reblog_of_id)) } scope :not_hidden_by_account, ->(account) do left_outer_joins(:mutes, :conversation_mute).where('(status_mutes.account_id IS NULL OR status_mutes.account_id != ?) AND (conversation_mutes.account_id IS NULL OR (conversation_mutes.account_id != ? AND conversation_mutes.hidden = TRUE))', account.id, account.id) @@ -535,15 +537,13 @@ class Status < ApplicationRecord Status.local when :remote Status.remote + when :local_reblogs + Status.locally_reblogged else Status end - starting_scope = starting_scope.with_public_visibility - if Setting.show_reblogs_in_public_timelines - starting_scope - else - starting_scope.without_reblogs - end + starting_scope = starting_scope.with_public_visibility.published + scope != :local_reblogs ? starting_scope.without_reblogs : starting_scope end def apply_timeline_filters(query, account, local_only) |