about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-16 18:35:20 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-16 18:35:20 +0200
commit1de2833f3045d48ab6d696a109a7a71f6a469135 (patch)
tree54952d6cec9478727489078a6d0ab6e21a8e989b /app
parentb8eda3026f2947fc7ac2c60df2878209e7327480 (diff)
Filter out reblogs of blocked users from public timeline (the not real-time variant)
Diffstat (limited to 'app')
-rw-r--r--app/models/status.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 111172e9a..3f150c5de 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -86,7 +86,7 @@ class Status < ApplicationRecord
   end
 
   def self.as_public_timeline(account)
-    where.not(account_id: account.blocking).with_includes.with_counters
+    joins('LEFT JOIN statuses AS reblogs ON reblogs.id = statuses.reblog_of_id').where('reblogs.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?) AND statuses.account_id NOT IN (SELECT target_account_id FROM blocks WHERE account_id = ?)', account.id, account.id).with_includes.with_counters
   end
 
   def self.favourites_map(status_ids, account_id)