Fix following restriction not working when exact match in account search (#14394)

lolsob-rspec
Takeshi Umeda 2020-07-27 06:58:36 +09:00 committed by GitHub
parent 1959db3fd1
commit 381ecf1d0b
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,7 @@ class AccountSearchService < BaseService
return @exact_match if defined?(@exact_match)
@exact_match = begin
match = begin
if options[:resolve]
ResolveAccountService.new.call(query)
elsif domain_is_local?
@ -36,6 +36,10 @@ class AccountSearchService < BaseService
Account.find_remote(query_username, query_domain)
end
end
match = nil if !match.nil? && !account.nil? && options[:following] && !account.following?(match)
@exact_match = match
end
def search_results