Skip to content
Snippets Groups Projects
Commit 05413879 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix #288 - Strip first @ from search query, don't search accounts if it begins with #

parent 6c82dfcf
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,9 @@
class SearchService < BaseService
def call(query, limit, resolve = false)
return if query.blank?
return if query.blank? || query.start_with?('#')
username, domain = query.split('@')
username, domain = query.gsub(/\A@/, '').split('@')
results = if domain.nil?
Account.search_for(username)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment