From cd5fadcd8d9df4a12e984cfc43193571dae5bdae Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Tue, 11 Aug 2020 16:27:47 -0500 Subject: [Privacy, Timelines] Improve filtering --- app/models/status.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/models') diff --git a/app/models/status.rb b/app/models/status.rb index ade8b4c85..e81331e93 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -502,15 +502,14 @@ class Status < ApplicationRecord else # followers can see followers-only stuff, but also things they are mentioned in. # non-followers can see everything that isn't private/direct, but can see stuff they are mentioned in. - scope = left_outer_joins(:reblog).published + visibility.push(:private) if account.following?(target_account) && user_signed_in + scope = left_outer_joins(:reblog) scope = scope.where(visibility: visibility) .or(scope.where(id: account.mentions.select(:status_id))) .merge(scope.where(reblog_of_id: nil).or(scope.where.not(reblogs_statuses: { account_id: account.excluded_from_timeline_account_ids }))) - scope = scope.or(scope.where(visibility: :private).without_replies) if account.following?(target_account) - - apply_timeline_filters(scope, account, false) + apply_timeline_filters(scope.published, account, false) end end -- cgit