From 8a17d5abbc9e5ba6881d2e8d7d06f1635b01a56b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 27 Jul 2014 11:12:06 +0200 Subject: [PATCH] Fix link of non-stacked wall comment (response) like links --- ...UserProfileCommentLikeUserNotificationEvent.class.php | 9 ++++++++- ...ileCommentResponseLikeUserNotificationEvent.class.php | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php index 0f2c50abc2..3808a786b8 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php @@ -80,7 +80,14 @@ class UserProfileCommentLikeUserNotificationEvent extends AbstractSharedUserNoti * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink() */ public function getLink() { - return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall'); + $owner = WCF::getUser(); + if ($this->additionalData['objectID'] != WCF::getUser()->userID) { + $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']); + } + + return LinkHandler::getInstance()->getLink('User', array( + 'object' => $owner + ), '#wall'); } /** diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php index 210ae34b26..3a02b267b3 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php @@ -84,7 +84,14 @@ class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractShared * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink() */ public function getLink() { - return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall'); + $owner = WCF::getUser(); + if ($this->additionalData['objectID'] != WCF::getUser()->userID) { + $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']); + } + + return LinkHandler::getInstance()->getLink('User', array( + 'object' => $owner + ), '#wall'); } /** -- 2.20.1