Add: メンション数上限 (#565)

* Add: メンション数上限

* Fix test
This commit is contained in:
KMY(雪あすか) 2024-02-17 09:50:06 +09:00 committed by GitHub
parent 5424567aef
commit 7411941885
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 94 additions and 5 deletions

View file

@ -82,7 +82,8 @@ class UpdateStatusService < BaseService
def validate_status!
raise Mastodon::ValidationError, I18n.t('statuses.contains_ng_words') if Admin::NgWord.reject?("#{@options[:spoiler_text]}\n#{@options[:text]}")
raise Mastodon::ValidationError, I18n.t('statuses.too_many_hashtags') if Admin::NgWord.hashtag_reject_with_extractor?(@options[:text])
raise Mastodon::ValidationError, I18n.t('statuses.too_many_hashtags') if Admin::NgWord.hashtag_reject_with_extractor?(@options[:text] || '')
raise Mastodon::ValidationError, I18n.t('statuses.too_many_mentions') if Admin::NgWord.mention_reject_with_extractor?(@options[:text] || '')
end
def validate_status_mentions!