diff options
author | Joas Schilling <coding@schilljs.com> | 2016-11-28 17:23:42 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-11-28 17:23:42 +0100 |
commit | b31d6218407e45c8d69e4b6cec3f73c92db5ffff (patch) | |
tree | 3fd700814fcf3e85a07c91e323c7226718802bd2 /apps | |
parent | a12d2e67e74874c7260d72c9a8fca87cdfd346a1 (diff) | |
download | nextcloud-server-b31d6218407e45c8d69e4b6cec3f73c92db5ffff.tar.gz nextcloud-server-b31d6218407e45c8d69e4b6cec3f73c92db5ffff.zip |
Add an icon to the federated sharing notification
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/federatedfilesharing/appinfo/app.php | 5 | ||||
-rw-r--r-- | apps/federatedfilesharing/lib/Notifier.php | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/federatedfilesharing/appinfo/app.php b/apps/federatedfilesharing/appinfo/app.php index 7f4e4601977..4a5492b0f15 100644 --- a/apps/federatedfilesharing/appinfo/app.php +++ b/apps/federatedfilesharing/appinfo/app.php @@ -31,10 +31,7 @@ $app->registerSettings(); $manager = \OC::$server->getNotificationManager(); $manager->registerNotifier(function() { - return new Notifier( - \OC::$server->getL10NFactory(), - \OC::$server->getContactsManager() - ); + return \OC::$server->query(Notifier::class); }, function() use ($l) { return [ 'id' => 'files_sharing', diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index 2cbbea2da42..507dd98330e 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -27,6 +27,7 @@ namespace OCA\FederatedFileSharing; use OC\HintException; use OC\Share\Helper; use OCP\Contacts\IManager; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; @@ -36,16 +37,20 @@ class Notifier implements INotifier { protected $factory; /** @var IManager */ protected $contactsManager; + /** @var IURLGenerator */ + protected $url; /** @var array */ protected $federatedContacts; /** * @param IFactory $factory * @param IManager $contactsManager + * @param IURLGenerator $url */ - public function __construct(IFactory $factory, IManager $contactsManager) { + public function __construct(IFactory $factory, IManager $contactsManager, IURLGenerator $url) { $this->factory = $factory; $this->contactsManager = $contactsManager; + $this->url = $url; } /** @@ -65,6 +70,8 @@ class Notifier implements INotifier { switch ($notification->getSubject()) { // Deal with known subjects case 'remote_share': + $notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'))); + $params = $notification->getSubjectParameters(); if ($params[0] !== $params[1] && $params[1] !== null) { $notification->setParsedSubject( |