Send notification on user mention

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-10-06 14:35:21 +02:00
parent 93c3c542e8
commit f66f4e0be0
3 changed files with 49 additions and 4 deletions

View File

@@ -105,6 +105,31 @@ class Notifier implements INotifier {
);
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '//card/' . $cardId . '');
break;
case 'card-comment-mentioned':
$cardId = $notification->getObjectId();
$boardId = $this->cardMapper->findBoardId($cardId);
$initiator = $this->userManager->get($params[2]);
if ($initiator !== null) {
$dn = $initiator->getDisplayName();
} else {
$dn = $params[2];
}
$notification->setParsedSubject(
(string) $l->t('%s has mentioned in a comment on "%s".', [$dn, $params[0]])
);
$notification->setRichSubject(
(string) $l->t('{user} has mentioned in a comment on "%s".', [$params[0]]),
[
'user' => [
'type' => 'user',
'id' => $params[0],
'name' => $dn,
]
]
);
$notification->setParsedMessage($notification->getMessage());
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '//card/' . $cardId . '');
break;
case 'board-shared':
$boardId = $notification->getObjectId();
$initiator = $this->userManager->get($params[1]);
@@ -131,4 +156,4 @@ class Notifier implements INotifier {
}
return $notification;
}
}
}