From 07339cf4906c93c2a79f395a8fb3104c852b1fa9 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Mon, 10 Aug 2020 18:10:06 -0500 Subject: [Timelines] Replace Federated timetime with public local reblogs when in local mode --- app/models/status.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/models') 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) -- cgit