about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-08-01 20:24:23 +0200
committerThibaut Girka <thib@sitedethib.com>2020-08-01 20:24:23 +0200
commit2cfa14296186913a7fead419dd6324ba42e3a446 (patch)
tree2ab943a2bc96097b0b35f607334ae12d59c98ea4 /app/services
parentab967cf5a0980934a68a4a4852ad25d10eec778e (diff)
parentbfd5aea20686559f030ca0f2538bebc1943b398b (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `yarn.lock`:
  No real conflict, just a glitch-soc-only dependency textually too close to
  one updated upstream. Ported upstream changes.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/account_search_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb
index 493813aab..43e596040 100644
--- a/app/services/account_search_service.rb
+++ b/app/services/account_search_service.rb
@@ -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