Replying to own page comment causes a notification
authorMarcel Werk <burntime@woltlab.com>
Sat, 23 May 2020 17:35:08 +0000 (19:35 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 23 May 2020 17:35:08 +0000 (19:35 +0200)
Closes #3259

wcfsetup/install/files/lib/data/comment/CommentAction.class.php

index 2a2b1b3d470a00b26d703afc0c349693a8f1fcfd..d6d68e515ae61cf79605f9bc231007f447865e28 100644 (file)
@@ -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]);
                                                }
                                        }