From: Cyperghost Date: Fri, 22 Mar 2024 10:33:56 +0000 (+0100) Subject: Add `isAffectedUser` function the comment `AbstractCommentResponseModerationQueueHandler` X-Git-Tag: 6.1.0_Alpha_1~142^2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a75c6f95af2015ab9958d6c77aef96ff2ba81cd1;p=GitHub%2FWoltLab%2FWCF.git Add `isAffectedUser` function the comment `AbstractCommentResponseModerationQueueHandler` --- diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php index 8b0baf16e8..d73f24ba85 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php @@ -10,6 +10,7 @@ use wcf\data\moderation\queue\ModerationQueue; use wcf\data\moderation\queue\ViewableModerationQueue; use wcf\system\cache\runtime\CommentResponseRuntimeCache; use wcf\system\cache\runtime\CommentRuntimeCache; +use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\WCF; @@ -163,4 +164,26 @@ class AbstractCommentResponseModerationQueueHandler extends AbstractCommentComme $responseAction->executeAction(); } } + + #[\Override] + public function isAffectedUser(ModerationQueue $queue, $userID) + { + if (!parent::isAffectedUser($queue, $userID)) { + return false; + } + $response = $this->getResponse($queue->objectID); + if ($response === null) { + return false; + } + $comment = $this->getComment($response->commentID); + if ($comment === null) { + return false; + } + + return $this->getCommentManager($comment)->canModerateObject( + $comment->objectTypeID, + $comment->objectID, + UserProfileRuntimeCache::getInstance()->getObject($userID) + ); + } }