Fix: #959 NGルールで絵文字リアクションを拒否した場合、自分のサーバーのカスタム絵文字は常に拒否される (#963)

* Fix: #959 NGルールで絵文字リアクションを拒否した場合、自分のサーバーのカスタム絵文字は常に拒否される

* Fix test

* Fix test
This commit is contained in:
KMY(雪あすか) 2025-01-28 12:22:20 +09:00 committed by GitHub
parent d2e3f7f0f4
commit bfa1700909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 3 deletions

View file

@ -62,9 +62,11 @@ class Admin::NgRule
return false if @ng_rule.reaction_allow_follower && (recipient.id == @account.id || (!recipient.local? && !@account.local?) || recipient.following?(@account))
if @options[:reaction_type] == 'emoji_reaction'
enum_match?(:reaction_type, @options[:reaction_type], @ng_rule.reaction_type) &&
text_match?(:emoji_reaction_name, @options[:emoji_reaction_name], @ng_rule.emoji_reaction_name) &&
text_match?(:emoji_reaction_origin_domain, @options[:emoji_reaction_origin_domain], @ng_rule.emoji_reaction_origin_domain)
result = enum_match?(:reaction_type, @options[:reaction_type], @ng_rule.reaction_type) &&
text_match?(:emoji_reaction_name, @options[:emoji_reaction_name], @ng_rule.emoji_reaction_name)
emoji_reaction_origin_domain = @options[:emoji_reaction_origin_domain] || Rails.configuration.x.local_domain
result && text_match?(:emoji_reaction_origin_domain, emoji_reaction_origin_domain, @ng_rule.emoji_reaction_origin_domain)
else
enum_match?(:reaction_type, @options[:reaction_type], @ng_rule.reaction_type)
end