]> cat aescling's git repositories - mastodon.git/commitdiff
Fix public timeline query
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 10 Nov 2016 20:58:22 +0000 (21:58 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 10 Nov 2016 20:58:22 +0000 (21:58 +0100)
app/models/status.rb

index 08b5e2cabe67890c206525e4489f914a381c54b2..9e27110083d29e1279008f6024438c42e074defd 100644 (file)
@@ -126,8 +126,8 @@ class Status < ApplicationRecord
       query
         .joins('LEFT OUTER JOIN statuses AS parents ON statuses.in_reply_to_id = parents.id')
         .joins('LEFT OUTER JOIN statuses AS reblogs ON statuses.reblog_of_id = reblogs.id')
-        .where('parents.account_id NOT IN (?)', blocked)
         .where('statuses.account_id NOT IN (?)', blocked)
+        .where('(parents.id IS NULL OR parents.account_id NOT IN (?))', blocked)
         .where('(reblogs.id IS NULL OR reblogs.account_id NOT IN (?))', blocked)
     end
   end