diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 9901a23c50..c0101c9b05 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -150,8 +150,8 @@ class SearchService < BaseService def following_account_ids return @following_account_ids if defined?(@following_account_ids) - account_exists_sql = Account.where('accounts.id = follows.target_account_id').where(searchability: %w(public unlisted private)).reorder(nil).select(1).to_sql - status_exists_sql = Status.where('statuses.account_id = follows.target_account_id').where(reblog_of_id: nil).where(searchability: %w(public unlisted private)).reorder(nil).select(1).to_sql + account_exists_sql = Account.where('accounts.id = follows.target_account_id').where(searchability: %w(public private)).reorder(nil).select(1).to_sql + status_exists_sql = Status.where('statuses.account_id = follows.target_account_id').where(reblog_of_id: nil).where(searchability: %w(public private)).reorder(nil).select(1).to_sql following_accounts = Follow.where(account_id: @account.id).merge(Account.where("EXISTS (#{account_exists_sql})").or(Account.where("EXISTS (#{status_exists_sql})"))) @following_account_ids = following_accounts.pluck(:target_account_id) end