Added "causer" and "notification" for the "ping" mechanism

This commit is contained in:
Michael 2021-08-19 14:57:35 +00:00
parent 6899d3c618
commit c0d187f281

View file

@ -162,7 +162,7 @@ class Notification extends BaseModel
* Create a notification message for the given notification
*
* @param array $notification
* @return array with the elements "plain" for plaintext and "rich" for richtext
* @return array with the elements "causer", "notification", "plain" and "rich"
*/
public static function getMessage(array $notification)
{
@ -299,7 +299,13 @@ class Notification extends BaseModel
}
if (!empty($msg)) {
// Name of the notification's causer
$message['causer'] = $contact['name'];
// Format for the "ping" mechanism
$message['notification'] = sprintf($msg, '{0}', $title);
// Plain text for the web push api
$message['plain'] = sprintf($msg, $contact['name'], $title);
// Rich text for other purposes
$message['rich'] = sprintf($msg,
'[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]',
'[url=' . $link . ']' . $title . '[/url]');