]> cat aescling's git repositories - mastodon.git/commitdiff
Actually fix public timeline
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 16 Oct 2016 23:59:34 +0000 (01:59 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 16 Oct 2016 23:59:34 +0000 (01:59 +0200)
app/models/status.rb

index f2935fea931efca45e6fdbee719f96370a017275..8b7c9c823669f875498fd7d20d98c51619b6cf4d 100644 (file)
@@ -86,7 +86,7 @@ class Status < ApplicationRecord
   end
 
   def self.as_public_timeline(account)
-    joins('LEFT OUTER 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
+    joins('LEFT OUTER JOIN statuses AS reblogs ON statuses.reblog_of_id = reblogs.id').where('(reblogs.account_id IS NULL OR 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)