OCA\Passman\Notifier: setIcon()

Set the icon for the notification.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
This commit is contained in:
Raymond Hackley 2025-07-28 10:15:22 +00:00
parent fcc5a29733
commit d1accd8788
No known key found for this signature in database
GPG key ID: 68CAC9134FD6F46E

View file

@ -23,6 +23,7 @@
namespace OCA\Passman;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
@ -31,6 +32,7 @@ class Notifier implements INotifier {
public function __construct(
protected IFactory $factory,
protected IURLGenerator $url,
) {
}
@ -47,6 +49,11 @@ class Notifier implements INotifier {
// Read the language from the notification
$l = $this->factory->get('passman', $languageCode);
// Set the icon for the notification
$notification->setIcon(
$this->url->getAbsoluteURL($this->url->imagePath('passman', 'app-dark.svg'))
);
switch ($notification->getSubject()) {
// Deal with known subjects
case 'credential_expired':