From: Marcel Werk Date: Thu, 9 Jan 2014 16:39:13 +0000 (+0100) Subject: Fixed wrong author in notifications X-Git-Tag: 2.0.2~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68b0d2bc4b7fdf093e7e25db5b975feb7c7ab9ee;p=GitHub%2FWoltLab%2FWCF.git Fixed wrong author in notifications --- diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 669560aa44..dda1e1bf98 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -87,8 +87,23 @@ class UserNotificationHandler extends SingletonFactory { // get objects $objectTypeObject = $this->availableObjectTypes[$objectType]; $event = $this->availableEvents[$objectType][$eventName]; + + // get author's profile + $userProfile = null; + if ($notificationObject->getAuthorID()) { + if ($notificationObject->getAuthorID() == WCF::getUser()->userID) { + $userProfile = new UserProfile(WCF::getUser()); + } + else { + $userProfile = UserProfile::getUserProfile($notificationObject->getAuthorID()); + } + } + if ($userProfile === null) { + $userProfile = new UserProfile(new User(null, array())); + } + // set object data - $event->setObject(new UserNotification(null, array()), $notificationObject, new UserProfile(WCF::getUser()), $additionalData); + $event->setObject(new UserNotification(null, array()), $notificationObject, $userProfile, $additionalData); // find existing events $userIDs = array();