Remove unnecessary code
authorFabii547 <fabiangossner@gmail.com>
Sat, 14 May 2016 09:18:05 +0000 (11:18 +0200)
committerFabii547 <fabiangossner@gmail.com>
Sat, 14 May 2016 09:18:05 +0000 (11:18 +0200)
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php

index 1a60438544815852361fd352a66d415baec75f5f..1fe400143b1c7b07361522783dec3dd5d7b5d919 100644 (file)
@@ -1,11 +1,9 @@
 <?php
 namespace wcf\system\user\notification\event;
-use wcf\system\cache\runtime\CommentRuntimeCache;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
-use wcf\system\request\LinkHandler;
 
 /**
- * User notification event for profile commment responses.
+ * User notification event for profile comment responses.
  * 
  * @author     Alexander Ebert
  * @copyright  2001-2016 WoltLab GmbH
@@ -24,9 +22,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @inheritDoc
         */
        protected function prepare() {
-               CommentRuntimeCache::getInstance()->cacheObjectID($this->userNotificationObject->commentID);
                UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
-               UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['userID']);
        }
        
        /**
@@ -48,8 +44,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @inheritDoc
         */
        public function getMessage() {
-               $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
-               $owner = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
+               $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
                
                $authors = $this->getAuthors();
                if (count($authors) > 1) {
@@ -77,8 +72,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @inheritDoc
         */
        public function getEmailMessage($notificationType = 'instant') {
-               $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
-               $owner = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
+               $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
                
                $authors = $this->getAuthors();
                if (count($authors) > 1) {
@@ -111,10 +105,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @inheritDoc
         */
        public function getLink() {
-               $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
-               $user = UserProfileRuntimeCache::getInstance()->getObject($comment->objectID);
-               
-               return LinkHandler::getInstance()->getLink('User', ['object' => $user], '#wall');
+               return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#wall';
        }
        
        /**