* Add: フォローしていないアカウントからのリプライのNGワード * Test: ハッシュタグ使用量
This commit is contained in:
parent
da662d2f84
commit
3a2030dfc8
8 changed files with 223 additions and 5 deletions
|
@ -18,6 +18,10 @@ class Admin::NgWord
|
|||
hashtag_reject?(Extractor.extract_hashtags(text)&.size || 0)
|
||||
end
|
||||
|
||||
def stranger_mention_reject?(text)
|
||||
ng_words_for_stranger_mention.any? { |word| include?(text, word) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def include?(text, word)
|
||||
|
@ -32,6 +36,10 @@ class Admin::NgWord
|
|||
Setting.ng_words || []
|
||||
end
|
||||
|
||||
def ng_words_for_stranger_mention
|
||||
Setting.ng_words_for_stranger_mention || []
|
||||
end
|
||||
|
||||
def post_hash_tags_max
|
||||
value = Setting.post_hash_tags_max
|
||||
value.is_a?(Integer) && value.positive? ? value : 0
|
||||
|
|
|
@ -38,6 +38,7 @@ class Form::AdminSettings
|
|||
status_page_url
|
||||
captcha_enabled
|
||||
ng_words
|
||||
ng_words_for_stranger_mention
|
||||
hide_local_users_for_anonymous
|
||||
post_hash_tags_max
|
||||
sensitive_words
|
||||
|
@ -91,6 +92,7 @@ class Form::AdminSettings
|
|||
|
||||
STRING_ARRAY_KEYS = %i(
|
||||
ng_words
|
||||
ng_words_for_stranger_mention
|
||||
sensitive_words
|
||||
sensitive_words_for_full
|
||||
).freeze
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue