Skip to content

Commit

Permalink
Merge pull request #475 from nextcloud/bugfix/noid/notification-handling
Browse files Browse the repository at this point in the history
fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti…
  • Loading branch information
nickvergessen authored Dec 23, 2024
2 parents 280d887 + d647a43 commit fe0b180
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Notifications/ExAppNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

namespace OCA\AppAPI\Notifications;

use InvalidArgumentException;
use OCA\AppAPI\AppInfo\Application;
use OCA\AppAPI\Service\ExAppService;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;

class ExAppNotifier implements INotifier {

Expand All @@ -38,10 +38,10 @@ public function getName(): string {
public function prepare(INotification $notification, string $languageCode): INotification {
$exApp = $this->service->getExApp($notification->getApp());
if ($exApp === null) {
throw new InvalidArgumentException();
throw new UnknownNotificationException();
}
if (!$exApp->getEnabled()) { // Only enabled ExApps can render notifications
throw new InvalidArgumentException('ExApp is disabled');
throw new UnknownNotificationException('ExApp is disabled');
}

$l = $this->l10nFactory->get($notification->getApp(), $languageCode);
Expand Down

0 comments on commit fe0b180

Please sign in to comment.