summaryrefslogtreecommitdiffstats
path: root/app/lib/search_query_transformer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/search_query_transformer.rb')
-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 c685d7b6fd7..aef05e9d9d8 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