Skip to content

Commit

Permalink
Merge pull request #1466 from nextcloud/bugfix/noid/notification-hand…
Browse files Browse the repository at this point in the history
…ling

fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti…
  • Loading branch information
juliusknorr authored Dec 27, 2024
2 parents 6bcc1e3 + 6796272 commit 3f2eb76
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use OCP\Notification\IManager as INotificationManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;
use OCP\User\Backend\ISetPasswordBackend;

class Notifier implements INotifier {
Expand Down Expand Up @@ -74,7 +75,7 @@ public function getName(): string {
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== 'firstrunwizard') {
// Not my app => throw
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}

switch ($notification->getSubject()) {
Expand All @@ -83,7 +84,7 @@ public function prepare(INotification $notification, string $languageCode): INot
if ($subject === '') {
// Everything done, mark the notification as processed...
$this->notificationManager->markProcessed($notification);
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}

$notification->setParsedSubject($subject)
Expand All @@ -105,7 +106,7 @@ public function prepare(INotification $notification, string $languageCode): INot
return $this->setAppHintDetails($notification, $languageCode, $app);
default:
// Unknown subject => Unknown notification => throw
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}
}

Expand Down

0 comments on commit 3f2eb76

Please sign in to comment.