Browse Source

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

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
054138797f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/services/search_service.rb

+ 2
- 2
app/services/search_service.rb View File

@ -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…
Cancel
Save