about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-08 23:00:03 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-04-08 23:00:03 +0200
commiteff62528debf33591c921b28ae2609c948161860 (patch)
tree76da7fad9be426213cafdc7f43cba5f00a047caa /app/lib
parentc483101b4ae7d9f22ea43921c512f479e16e98ca (diff)
parented5491e5de6ede501715c421ad5fa53493f61250 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/search_query_transformer.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/lib/search_query_transformer.rb b/app/lib/search_query_transformer.rb
index c685d7b6f..aef05e9d9 100644
--- a/app/lib/search_query_transformer.rb
+++ b/app/lib/search_query_transformer.rb
@@ -88,14 +88,14 @@ class SearchQueryTransformer < Parslet::Transform
       case prefix
       when 'from'
         @filter = :account_id
-        username, domain = term.split('@')
-        account = Account.find_remote(username, domain)
 
-        raise "Account not found: #{term}" unless account
+        username, domain = term.gsub(/\A@/, '').split('@')
+        domain           = nil if TagManager.instance.local_domain?(domain)
+        account          = Account.find_remote!(username, domain)
 
         @term = account.id
       else
-        raise "Unknown prefix: #{prefix}"
+        raise Mastodon::SyntaxError
       end
     end
   end