diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-10-10 17:26:08 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-10-10 17:26:08 +0200 |
commit | 61631f475163c5640a78ff66f0ac6c053cda2f84 (patch) | |
tree | 78920c924924b76872d420c27a8c62fb1b7f6bb7 /app/services | |
parent | bc0399d54dde2ad058a8382fc3edbe5506a92985 (diff) | |
parent | a57ac0723f5918b12838da8373d51706cb461a4e (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - README.md - app/javascript/styles/mastodon/components.scss conflicts caused by image URLs being different - app/models/status.rb as_home_timeline removed, kept glitch-soc-only as_direct_timeline - app/views/statuses/_simple_status.html.haml - config/locales/en.yml some strings were changed upstream - spec/models/status_spec.rb as_home_timeline removed, kept glitch-soc-only as_direct_timeline
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/hashtag_query_service.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/hashtag_query_service.rb b/app/services/hashtag_query_service.rb index 282821710..196de0639 100644 --- a/app/services/hashtag_query_service.rb +++ b/app/services/hashtag_query_service.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class HashtagQueryService < BaseService + LIMIT_PER_MODE = 4 + def call(tag, params, account = nil, local = false) tags = tags_for(Array(tag.name) | Array(params[:any])).pluck(:id) all = tags_for(params[:all]) @@ -15,6 +17,6 @@ class HashtagQueryService < BaseService private def tags_for(names) - Tag.matching_name(names) if names.presence + Tag.matching_name(Array(names).take(LIMIT_PER_MODE)) if names.present? end end |