Skip to content

Commit 90b6b35

Browse files
OCA\Passman\Notifier: setIcon()
Set the icon for the notification. Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
1 parent d184c3f commit 90b6b35

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/Notifier.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace OCA\Passman;
2525

26+
use OCP\IURLGenerator;
2627
use OCP\L10N\IFactory;
2728
use OCP\Notification\INotification;
2829
use OCP\Notification\INotifier;
@@ -31,6 +32,7 @@ class Notifier implements INotifier {
3132

3233
public function __construct(
3334
protected IFactory $factory,
35+
protected IURLGenerator $url,
3436
) {
3537
}
3638

@@ -47,6 +49,11 @@ public function prepare(INotification $notification, string $languageCode): INot
4749
// Read the language from the notification
4850
$l = $this->factory->get('passman', $languageCode);
4951

52+
// Set the icon for the notification
53+
$notification->setIcon(
54+
$this->url->getAbsoluteURL($this->url->imagePath('passman', 'app-dark.svg'))
55+
);
56+
5057
switch ($notification->getSubject()) {
5158
// Deal with known subjects
5259
case 'credential_expired':

0 commit comments

Comments
 (0)