2 namespace wcf\system\user\notification\event;
3 use wcf\system\cache\runtime\UserProfileRuntimeCache;
4 use wcf\system\email\Email;
7 * User notification event for profile comment responses.
9 * @author Alexander Ebert
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\System\User\Notification\Event
14 class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUserNotificationEvent {
18 protected $stackable = true;
23 protected function prepare() {
24 UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['objectID']);
30 public function getTitle() {
31 $count = count($this->getAuthors());
33 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.title.stacked', [
35 'timesTriggered' => $this->notification->timesTriggered
39 return $this->getLanguage()->get('wcf.user.notification.commentResponse.title');
45 public function getMessage() {
46 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
48 $authors = $this->getAuthors();
49 if (count($authors) > 1) {
50 if (isset($authors[0])) {
53 $count = count($authors);
55 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message.stacked', [
56 'authors' => array_values($authors),
58 'others' => $count - 1,
60 'guestTimesTriggered' => $this->notification->guestTimesTriggered
64 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message', [
65 'author' => $this->author,
73 public function getEmailMessage($notificationType = 'instant') {
74 $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']);
76 $messageID = '<com.woltlab.wcf.user.profileComment.notification/'.$comment->commentID.'@'.Email::getHost().'>';
79 'template' => 'email_notification_userProfileCommentResponse',
80 'application' => 'wcf',
81 'in-reply-to' => [$messageID],
82 'references' => [$messageID],
92 public function getLink() {
93 return UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID'])->getLink() . '#wall';
99 public function getEventHash() {
100 return sha1($this->eventID . '-' . $this->userNotificationObject->commentID);