diff --git a/apps/updatenotification/appinfo/app.php b/apps/updatenotification/appinfo/app.php index f5bcf34566..e3010d418b 100644 --- a/apps/updatenotification/appinfo/app.php +++ b/apps/updatenotification/appinfo/app.php @@ -43,10 +43,7 @@ if(\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) { $manager = \OC::$server->getNotificationManager(); $manager->registerNotifier(function() use ($manager) { - return new \OCA\UpdateNotification\Notification\Notifier( - $manager, - \OC::$server->getL10NFactory() - ); + return \OC::$server->query(\OCA\UpdateNotification\Notification\Notifier::class); }, function() { $l = \OC::$server->getL10N('updatenotification'); return [ diff --git a/apps/updatenotification/img/notification.svg b/apps/updatenotification/img/notification.svg new file mode 100644 index 0000000000..7a3f6270cb --- /dev/null +++ b/apps/updatenotification/img/notification.svg @@ -0,0 +1 @@ + diff --git a/apps/updatenotification/lib/Notification/Notifier.php b/apps/updatenotification/lib/Notification/Notifier.php index 3e1bc94425..ccc2c2b6e2 100644 --- a/apps/updatenotification/lib/Notification/Notifier.php +++ b/apps/updatenotification/lib/Notification/Notifier.php @@ -24,6 +24,7 @@ namespace OCA\UpdateNotification\Notification; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\IManager; use OCP\Notification\INotification; @@ -31,6 +32,9 @@ use OCP\Notification\INotifier; class Notifier implements INotifier { + /** @var IURLGenerator */ + protected $url; + /** @var IManager */ protected $notificationManager; @@ -43,10 +47,12 @@ class Notifier implements INotifier { /** * Notifier constructor. * + * @param IURLGenerator $url * @param IManager $notificationManager * @param IFactory $l10NFactory */ - public function __construct(IManager $notificationManager, IFactory $l10NFactory) { + public function __construct(IURLGenerator $url, IManager $notificationManager, IFactory $l10NFactory) { + $this->url = $url; $this->notificationManager = $notificationManager; $this->l10NFactory = $l10NFactory; $this->appVersions = $this->getAppVersions(); @@ -81,6 +87,8 @@ class Notifier implements INotifier { $notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()])); } + $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('updatenotification', 'notification.svg'))); + return $notification; }