From: Tim Düsterhus Date: Fri, 29 Jul 2016 20:44:02 +0000 (+0200) Subject: Fix UserProfileCommentResponse*UserNotificationEvent email notifications X-Git-Tag: 3.0.0_Beta_1~891 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=43f5650769d2522642d1aa1e7cdebec01a01674c;p=GitHub%2FWoltLab%2FWCF.git Fix UserProfileCommentResponse*UserNotificationEvent email notifications --- 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().'>';