From 8c7c47e14a11a852f233e898da283f31b98ef9ad Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 23 May 2020 19:35:08 +0200 Subject: [PATCH] Replying to own page comment causes a notification Closes #3259 --- .../files/lib/data/comment/CommentAction.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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]); } } -- 2.20.1