about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorhappycoloredbanana <happycoloredbanana@users.noreply.github.com>2017-05-27 01:55:08 +0300
committerEugen Rochko <eugen@zeonfederated.com>2017-05-27 00:55:08 +0200
commit9642601126541347cbf6f49105ba7254e0ab234a (patch)
treea500f6e9b8d831e5670f37d2cbc3ff143212d1b9 /app/services
parent3836d293a155b491299854149a1b3dc5adcd1b7f (diff)
Avoid comparing domains when looking for an exact match of a local account (#3336)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/account_search_service.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb
index 04b2ed958..2b77ad7c6 100644
--- a/app/services/account_search_service.rb
+++ b/app/services/account_search_service.rb
@@ -59,7 +59,13 @@ class AccountSearchService < BaseService
   end
 
   def exact_match
-    @_exact_match ||= Account.find_remote(query_username, query_domain)
+    @_exact_match ||= begin
+      if domain_is_local?
+        Account.find_local(query_username)
+      else
+        Account.find_remote(query_username, query_domain)
+      end
+    end
   end
 
   def search_results