Merge pull request #24531 from nextcloud/backport/24516/stable20

[stable20] Add icon to user limit notification
This commit is contained in:
Morris Jobke 2020-12-03 11:14:03 +01:00 committed by GitHub
commit 73f854dc0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -29,6 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Notification; namespace OC\Core\Notification;
use OCP\IURLGenerator;
use OCP\L10N\IFactory; use OCP\L10N\IFactory;
use OCP\Notification\INotification; use OCP\Notification\INotification;
use OCP\Notification\INotifier; use OCP\Notification\INotifier;
@ -36,9 +37,12 @@ use OCP\Notification\INotifier;
class CoreNotifier implements INotifier { class CoreNotifier implements INotifier {
/** @var IFactory */ /** @var IFactory */
private $l10nFactory; private $l10nFactory;
/** @var IURLGenerator */
private $url;
public function __construct(IFactory $factory) { public function __construct(IFactory $factory, IURLGenerator $url) {
$this->l10nFactory = $factory; $this->l10nFactory = $factory;
$this->url = $url;
} }
/** /**
@ -76,8 +80,9 @@ class CoreNotifier implements INotifier {
if ($notification->getSubject() === 'user_limit_reached') { if ($notification->getSubject() === 'user_limit_reached') {
$notification->setParsedSubject($l->t('The user limit of this instance is 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->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/order/'); $notification->setLink('https://nextcloud.com/enterprise/');
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg')));
return $notification; return $notification;
} }