From: Marcel Werk Date: Sat, 23 May 2020 17:35:08 +0000 (+0200) Subject: Replying to own page comment causes a notification X-Git-Tag: 5.2.7~51 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c7c47e14a11a852f233e898da283f31b98ef9ad;p=GitHub%2FWoltLab%2FWCF.git Replying to own page comment causes a notification Closes #3259 --- diff --git a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php index 2a2b1b3d47..d6d68e515a 100644 --- a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php @@ -626,21 +626,22 @@ class CommentAction extends AbstractDatabaseObjectAction implements IMessageInli $recipientIDs = array_diff($recipientIDs, [WCF::getUser()->userID]); if ($notificationObjectType instanceof IMultiRecipientCommentResponseOwnerUserNotificationObjectType) { - if ($notificationObjectType->getCommentOwnerID($comment)) { + $userID = $notificationObjectType->getCommentOwnerID($comment); + if ($userID && $userID != WCF::getUser()->userID) { UserNotificationHandler::getInstance()->fireEvent( 'commentResponseOwner', $objectType->objectType . '.response.notification', $notificationObject, - [$notificationObjectType->getCommentOwnerID($comment)], + [$userID], [ 'commentID' => $comment->commentID, 'objectID' => $comment->objectID, - 'objectUserID' => $notificationObjectType->getCommentOwnerID($comment), + 'objectUserID' => $userID, 'userID' => $comment->userID ] ); - $recipientIDs = array_diff($recipientIDs, [$notificationObjectType->getCommentOwnerID($comment)]); + $recipientIDs = array_diff($recipientIDs, [$userID]); } }