fix(notifications): Notifier::prepare() threw \InvalidArgumentException which is deprecated

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling
2024-12-20 15:12:36 +01:00
parent 774b5f11cd
commit 6ceecd4f9b

View File

@@ -16,6 +16,7 @@ use OCP\L10N\IFactory;
use OCP\Notification\AlreadyProcessedException;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;
class Notifier implements INotifier {
/** @var IFactory */
@@ -77,7 +78,7 @@ class Notifier implements INotifier {
public function prepare(INotification $notification, string $languageCode): INotification {
$l = $this->l10nFactory->get('deck', $languageCode);
if ($notification->getApp() !== 'deck') {
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('deck', 'deck-dark.svg')));
$params = $notification->getSubjectParameters();