summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-12-01 15:33:13 +0100
committerJoas Schilling <coding@schilljs.com>2016-12-01 15:36:22 +0100
commit1aefbed55fab34c4d20b332b6d2ee3d703c6aada (patch)
treea3388a79c57b9144676326071bfb57627f869de9
parent917cac543637016743f5375ce54c5240b0263130 (diff)
downloadnextcloud-server-1aefbed55fab34c4d20b332b6d2ee3d703c6aada.tar.gz
nextcloud-server-1aefbed55fab34c4d20b332b6d2ee3d703c6aada.zip
Highlight the app name in the notification
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--apps/updatenotification/lib/Notification/Notifier.php9
-rw-r--r--lib/public/RichObjectStrings/Definitions.php18
2 files changed, 26 insertions, 1 deletions
diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php
index ccc2c2b6e29..00cc94095ca 100644
--- a/apps/updatenotification/lib/Notification/Notifier.php
+++ b/apps/updatenotification/lib/Notification/Notifier.php
@@ -84,7 +84,14 @@ class Notifier implements INotifier {
$this->updateAlreadyInstalledCheck($notification, $this->appVersions[$notification->getObjectType()]);
}
- $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()]));
+ $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()]))
+ ->setRichSubject($l->t('Update for {app} to version %s is available.', $notification->getObjectId()), [
+ 'app' => [
+ 'type' => 'app',
+ 'id' => $notification->getObjectType(),
+ 'name' => $appName,
+ ]
+ ]);
}
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('updatenotification', 'notification.svg')));
diff --git a/lib/public/RichObjectStrings/Definitions.php b/lib/public/RichObjectStrings/Definitions.php
index 2b35f9ceed1..5f813f089f3 100644
--- a/lib/public/RichObjectStrings/Definitions.php
+++ b/lib/public/RichObjectStrings/Definitions.php
@@ -96,6 +96,24 @@ class Definitions {
],
],
],
+ 'app' => [
+ 'author' => 'Nextcloud',
+ 'app' => 'updatenotification',
+ 'since' => '11.0.0',
+ 'parameters' => [
+ 'id' => [
+ 'since' => '11.0.0',
+ 'required' => true, 'description' => 'The app id',
+ 'example' => 'updatenotification',
+ ],
+ 'name' => [
+ 'since' => '11.0.0',
+ 'required' => true,
+ 'description' => 'The name of the app which should be used in the visual representation',
+ 'example' => 'Update notification',
+ ],
+ ],
+ ],
'calendar' => [
'author' => 'Nextcloud',
'app' => 'dav',