From 0a345ad5e109c98f7115912c359175d258e39025 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 7 Aug 2024 08:52:10 +0200 Subject: [PATCH] Fix logic of block/mute bypass for mentions from moderators (#31271) --- app/services/notify_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb index 759d6e3937..2001fa6dac 100644 --- a/app/services/notify_service.rb +++ b/app/services/notify_service.rb @@ -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?