From 43f5650769d2522642d1aa1e7cdebec01a01674c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 29 Jul 2016 22:44:02 +0200 Subject: [PATCH] Fix UserProfileCommentResponse*UserNotificationEvent email notifications --- ...CommentResponseOwnerUserNotificationEvent.class.php | 10 ++++------ ...ofileCommentResponseUserNotificationEvent.class.php | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php index cdf4ab2245..aec85c19f6 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php @@ -87,15 +87,13 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare * @inheritDoc */ public function getEmailMessage($notificationType = 'instant') { - $comment = new Comment($this->getUserNotificationObject()->commentID); - $owner = new User($comment->objectID); + $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID); + $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']); if ($comment->userID) { - $commentAuthor = new User($comment->userID); + $commentAuthor = UserProfileRuntimeCache::getInstance()->getObject($comment->userID); } else { - $commentAuthor = new User(null, [ - 'username' => $comment->username - ]); + $commentAuthor = UserProfile::getGuestUserProfile($comment->username); } $messageID = 'commentID.'@'.Email::getHost().'>'; diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php index ac7ea1e4b6..b9f699de77 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php @@ -1,5 +1,6 @@ cacheObjectID($this->getUserNotificationObject()->commentID); UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']); } @@ -71,6 +73,7 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser * @inheritDoc */ public function getEmailMessage($notificationType = 'instant') { + $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID); $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']); $messageID = 'commentID.'@'.Email::getHost().'>'; -- 2.20.1