Fix link of non-stacked wall comment (response) like links
authorMatthias Schmidt <gravatronics@live.com>
Sun, 27 Jul 2014 09:12:06 +0000 (11:12 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 27 Jul 2014 09:12:06 +0000 (11:12 +0200)
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php

index 0f2c50abc2d9f8329ed0dd0b80e98bb8fd47f1f0..3808a786b879235fb42c44eca424e2187c901e04 100644 (file)
@@ -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');
        }
        
        /**
index 210ae34b267bf43237fcfccee6df08ee46466c57..3a02b267b34fcf8c22815c9d8618bbf6dca36493 100644 (file)
@@ -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');
        }
        
        /**