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