diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-11-10 13:27:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 13:27:40 +0100 |
commit | ee7e49d1b1323618e16026bc8db8ab7f9459cc2d (patch) | |
tree | 86d51ac7c13d2b08fae534a44524c2ef8b131315 /app/services/account_search_service.rb | |
parent | b2a25d446a9f4368ad9d1240b9da30bc33942da5 (diff) | |
parent | c4d2c729245fab1dda31d0de73be9bc03217b06a (diff) |
Merge pull request #1910 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/account_search_service.rb')
-rw-r--r-- | app/services/account_search_service.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb index 9f2330a94..85538870b 100644 --- a/app/services/account_search_service.rb +++ b/app/services/account_search_service.rb @@ -3,6 +3,8 @@ class AccountSearchService < BaseService attr_reader :query, :limit, :offset, :options, :account + MENTION_ONLY_RE = /\A#{Account::MENTION_RE}\z/i + # Min. number of characters to look for non-exact matches MIN_QUERY_LENGTH = 5 @@ -180,7 +182,7 @@ class AccountSearchService < BaseService end def username_complete? - query.include?('@') && "@#{query}".match?(/\A#{Account::MENTION_RE}\Z/) + query.include?('@') && "@#{query}".match?(MENTION_ONLY_RE) end def likely_acct? |