|
|
@ -49,7 +49,7 @@ class SearchService < BaseService |
|
|
|
results = definition.limit(@limit).offset(@offset).objects.compact |
|
|
|
account_ids = results.map(&:account_id) |
|
|
|
account_domains = results.map(&:account_domain) |
|
|
|
preloaded_relations = relations_map_for_account(@account, account_ids, account_domains) |
|
|
|
preloaded_relations = @account.relations_map(account_ids, account_domains) |
|
|
|
|
|
|
|
results.reject { |status| StatusFilter.new(status, @account, preloaded_relations).filtered? } |
|
|
|
rescue Faraday::ConnectionFailed, Parslet::ParseFailed |
|
|
@ -111,16 +111,6 @@ class SearchService < BaseService |
|
|
|
@options[:type].blank? || @options[:type] == 'statuses' |
|
|
|
end |
|
|
|
|
|
|
|
def relations_map_for_account(account, account_ids, domains) |
|
|
|
{ |
|
|
|
blocking: Account.blocking_map(account_ids, account.id), |
|
|
|
blocked_by: Account.blocked_by_map(account_ids, account.id), |
|
|
|
muting: Account.muting_map(account_ids, account.id), |
|
|
|
following: Account.following_map(account_ids, account.id), |
|
|
|
domain_blocking_by_domain: Account.domain_blocking_map_by_domain(domains, account.id), |
|
|
|
} |
|
|
|
end |
|
|
|
|
|
|
|
def parsed_query |
|
|
|
SearchQueryTransformer.new.apply(SearchQueryParser.new.parse(@query)) |
|
|
|
end |
|
|
|