@ -88,12 +88,10 @@ class Status < ApplicationRecord
end
defas_public_timeline(account=nil)
query=joins('LEFT OUTER JOIN statuses AS reblogs ON statuses.reblog_of_id = reblogs.id')
.joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id')
.where('accounts.silenced = FALSE')
query=joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id').where('accounts.silenced = FALSE')
unlessaccount.nil?
query=query.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)
query=filter_timeline(query,account)
end
query.with_includes.with_counters
@ -101,12 +99,11 @@ class Status < ApplicationRecord
defas_tag_timeline(tag,account=nil)
query=tag.statuses
.joins('LEFT OUTER JOIN statuses AS reblogs ON statuses.reblog_of_id = reblogs.id')
.joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id')
.where('accounts.silenced = FALSE')
unlessaccount.nil?
query=query.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)
query=filter_timeline(query,account)
end
query.with_includes.with_counters
@ -119,6 +116,19 @@ class Status < ApplicationRecord