about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-11 16:27:47 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commitcd5fadcd8d9df4a12e984cfc43193571dae5bdae (patch)
tree675659dd525d34cd46edb0ff93f981f185010822 /app/models
parent50cb758cb53f3510d433de330dd3480d2a5d224d (diff)
[Privacy, Timelines] Improve filtering
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb7
1 files changed, 3 insertions, 4 deletions
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