summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib/Notification/BackgroundJob.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/updatenotification/lib/Notification/BackgroundJob.php')
-rw-r--r--apps/updatenotification/lib/Notification/BackgroundJob.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/updatenotification/lib/Notification/BackgroundJob.php b/apps/updatenotification/lib/Notification/BackgroundJob.php
index 70cde58bcb4..3a1aa5e0f16 100644
--- a/apps/updatenotification/lib/Notification/BackgroundJob.php
+++ b/apps/updatenotification/lib/Notification/BackgroundJob.php
@@ -98,8 +98,8 @@ class BackgroundJob extends TimedJob {
$status = $updater->check();
if (isset($status['version'])) {
- $url = $this->urlGenerator->linkToRouteAbsolute('settings_admin') . '#updater';
- $this->createNotifications('core', $status['version'], $url);
+ $url = $this->urlGenerator->linkToRouteAbsolute('settings.AdminSettings.index') . '#updater';
+ $this->createNotifications('core', $status['version'], $url, $status['versionstring']);
}
}
@@ -123,8 +123,9 @@ class BackgroundJob extends TimedJob {
* @param string $app
* @param string $version
* @param string $url
+ * @param string $visibleVersion
*/
- protected function createNotifications($app, $version, $url) {
+ protected function createNotifications($app, $version, $url, $visibleVersion = '') {
$lastNotification = $this->config->getAppValue('updatenotification', $app, false);
if ($lastNotification === $version) {
// We already notified about this update
@@ -139,9 +140,14 @@ class BackgroundJob extends TimedJob {
$notification->setApp('updatenotification')
->setDateTime(new \DateTime())
->setObject($app, $version)
- ->setSubject('update_available')
->setLink($url);
+ if ($visibleVersion !== '') {
+ $notification->setSubject('update_available', ['version' => $visibleVersion]);
+ } else {
+ $notification->setSubject('update_available');
+ }
+
foreach ($this->getUsersToNotify() as $uid) {
$notification->setUser($uid);
$this->notificationManager->notify($notification);