about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-12-06 19:44:23 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-12-06 11:44:23 +0100
commitd7a17b5e8b53cd9cebe500460d2ff19d5268ef96 (patch)
tree9436a9bcf3792c70ecd01e2a98f2860ac92f305b
parent34e2a06de0fdb949667df985475a6eadb278544e (diff)
Search only from followees (#5897)
-rw-r--r--app/services/account_search_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb
index ce25c3620..a289ceac4 100644
--- a/app/services/account_search_service.rb
+++ b/app/services/account_search_service.rb
@@ -58,12 +58,16 @@ class AccountSearchService < BaseService
     @_domain_is_local ||= TagManager.instance.local_domain?(query_domain)
   end
 
+  def search_from
+    options[:following] && account ? account.following : Account
+  end
+
   def exact_match
     @_exact_match ||= begin
       if domain_is_local?
-        Account.find_local(query_username)
+        search_from.find_local(query_username)
       else
-        Account.find_remote(query_username, query_domain)
+        search_from.find_remote(query_username, query_domain)
       end
     end
   end