Fix account search showing results from domains hidden by user

Fix #8586
This commit is contained in:
Eugen Rochko 2020-08-31 17:22:04 +02:00
parent 52157fdcba
commit 34a62ff423

View file

@ -48,7 +48,17 @@ class AccountSearchService < BaseService
@search_results ||= begin
results = from_elasticsearch if Chewy.enabled?
results ||= from_database
results
results.reject { |result| excluded_domains.include?(result.domain) }
end
end
def excluded_domains
@excluded_domains ||= begin
if account
Set.new(account.excluded_from_timeline_domains)
else
Set.new
end
end
end