From 3d132f293ff36ff1b63a321f7a625657aeabc01b Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 2 Dec 2020 20:13:33 +0100 Subject: [PATCH 1/2] Add icon to user limit notification Signed-off-by: Morris Jobke --- core/Notification/CoreNotifier.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/Notification/CoreNotifier.php b/core/Notification/CoreNotifier.php index dd362dac8c..2e020161b8 100644 --- a/core/Notification/CoreNotifier.php +++ b/core/Notification/CoreNotifier.php @@ -29,6 +29,7 @@ declare(strict_types=1); namespace OC\Core\Notification; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; @@ -36,9 +37,12 @@ use OCP\Notification\INotifier; class CoreNotifier implements INotifier { /** @var IFactory */ private $l10nFactory; + /** @var IURLGenerator */ + private $url; - public function __construct(IFactory $factory) { + public function __construct(IFactory $factory, IURLGenerator $url) { $this->l10nFactory = $factory; + $this->url = $url; } /** @@ -78,6 +82,7 @@ class CoreNotifier implements INotifier { $notification->setParsedSubject($l->t('The user limit of this instance is reached.')); $notification->setParsedMessage($l->t('Add a subscription key to increase the user limit of this instance. For more information have a look at the Enterprise subscription page.')); $notification->setLink('https://nextcloud.com/enterprise/order/'); + $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg'))); return $notification; } From 4c5662a65801007c34b8f40563016973accf23a9 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 2 Dec 2020 21:42:32 +0100 Subject: [PATCH 2/2] Improve wording Signed-off-by: Morris Jobke --- core/Notification/CoreNotifier.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Notification/CoreNotifier.php b/core/Notification/CoreNotifier.php index 2e020161b8..709d83ab9c 100644 --- a/core/Notification/CoreNotifier.php +++ b/core/Notification/CoreNotifier.php @@ -80,8 +80,8 @@ class CoreNotifier implements INotifier { if ($notification->getSubject() === 'user_limit_reached') { $notification->setParsedSubject($l->t('The user limit of this instance is reached.')); - $notification->setParsedMessage($l->t('Add a subscription key to increase the user limit of this instance. For more information have a look at the Enterprise subscription page.')); - $notification->setLink('https://nextcloud.com/enterprise/order/'); + $notification->setParsedMessage($l->t('Enter your subscription key to increase the user limit. For more information about Nextcloud Enterprise see our website.')); + $notification->setLink('https://nextcloud.com/enterprise/'); $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg'))); return $notification; }