about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-06-06 21:13:30 +0200
committerGitHub <noreply@github.com>2018-06-06 21:13:30 +0200
commit59b42188a73b7c7c09d91b1111a31d72f2f6e9b7 (patch)
tree360ee6a86e0c24fabb8f629dc645c7d58daa739f
parent683707839f6e61df95a4958675883c8f80aa6a84 (diff)
Filter out blocked/muted people from profile timelines (#7747)
Fix #7741
-rw-r--r--app/models/status.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 5189e173d..7fa069083 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -305,7 +305,11 @@ class Status < ApplicationRecord
         # 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)
 
-        where(visibility: visibility).or(where(id: account.mentions.select(:status_id)))
+        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 })))
       end
     end