Fix logic of block/mute bypass for mentions from moderators (#31271)

This commit is contained in:
Claire 2024-08-07 08:52:10 +02:00
parent 29c35ef4f9
commit 0a345ad5e1

View file

@ -86,7 +86,8 @@ class NotifyService < BaseService
end
def from_staff?
@notification.from_account.local? && @notification.from_account.user.present? && @notification.from_account.user_role&.overrides?(@recipient.user_role)
sender = @notification.from_account
sender.local? && sender.user.present? && sender.user_role&.overrides?(@recipient.user_role) && @sender.user_role&.highlighted? && sender.user_role&.can?(*UserRole::Flags::CATEGORIES[:moderation])
end
def optional_non_following_and_direct?