Skip to content

Commit

Permalink
Merge pull request #1272 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
skjnldsv authored Jan 7, 2025
2 parents 41b7229 + f69bbfb commit 208a895
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Notifications/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

namespace OCA\Guests\Notifications;

use InvalidArgumentException;
use OCA\Guests\AppInfo\Application;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;

class Notifier implements INotifier {
public function __construct(
Expand Down Expand Up @@ -51,12 +51,12 @@ private function getRichMessageParams(string $source, string $target): array {
}

/**
* @throws InvalidArgumentException
* @throws UnknownNotificationException
*/
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== Application::APP_ID) {
// Not my app => throw
throw new InvalidArgumentException();
throw new UnknownNotificationException();
}

// Read the language from the notification
Expand Down Expand Up @@ -95,7 +95,7 @@ public function prepare(INotification $notification, string $languageCode): INot

default:
// Unknown subject => Unknown notification => throw
throw new InvalidArgumentException();
throw new UnknownNotificationException();
}
}
}

0 comments on commit 208a895

Please sign in to comment.