diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-08-10 18:10:06 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:17 -0500 |
commit | 07339cf4906c93c2a79f395a8fb3104c852b1fa9 (patch) | |
tree | 09cdefc1476364970c84c1d96b2cf99510cf27d9 /app/models | |
parent | 034315fffe528c5181640b6f372a5822bf405f1a (diff) |
[Timelines] Replace Federated timetime with public local reblogs when in local mode
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) |