mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-03 17:56:26 +01:00
Fix #288 - Strip first @ from search query, don't search accounts if it begins with #
This commit is contained in:
parent
6c82dfcf5f
commit
054138797f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user