about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-02-21 05:59:14 +0000
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:21 -0500
commit178a2dc9eba4e41b64401fb33add81f33aa3e955 (patch)
tree7ff4066e83107bd8e0c2396335a0a9cfe0e0d7d5 /app
parentf1ed7bb67500eb8892c0167110746f06a2525160 (diff)
hide follower-only replies on account tls
Diffstat (limited to 'app')
-rw-r--r--app/models/status.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 80a3c8208..cbb89bd16 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -439,13 +439,13 @@ 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.
-        visibility.push(:private) if account.following?(target_account)
-
         scope = left_outer_joins(:reblog)
 
-        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 })))
+        query = scope.where(visibility: visibility).or(scope.where(id: account.mentions.select(:status_id)))
+        if account.following?(target_account) then
+          query = query.or(scope.where(visibility: :private).without_replies)
+        end
+        query.merge(scope.where(reblog_of_id: nil).or(scope.where.not(reblogs_statuses: { account_id: account.excluded_from_timeline_account_ids })))
       end
     end