From 3cd540a064ac28c638f550e66da0a3d19b6267ad Mon Sep 17 00:00:00 2001 From: Jana Peper Date: Fri, 22 May 2026 14:18:39 +0200 Subject: [PATCH 1/2] fix: use UnknownNotificationException instead of Activity one Signed-off-by: Jana Peper --- lib/Notification/Notifier.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 90428acd..b9197197 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -8,13 +8,14 @@ namespace OCA\Assistant\Notification; use OCA\Assistant\AppInfo\Application; -use OCP\Activity\Exceptions\UnknownActivityException; + use OCP\App\IAppManager; use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\IAction; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; use OCP\TaskProcessing\IManager as ITaskProcessingManager; use OCP\TaskProcessing\TaskTypes\AudioToText; use OCP\TaskProcessing\TaskTypes\TextToImage; @@ -56,13 +57,13 @@ public function getName(): string { * @param INotification $notification * @param string $languageCode The code of the language that should be used to prepare the notification * @return INotification - * @throws UnknownActivityException When the notification was not prepared by a notifier + * @throws UnknownNotificationException When the notification was not prepared by a notifier * @since 9.0.0 */ public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) { // Not my app => throw - throw new UnknownActivityException(); + throw new UnknownNotificationException(); } $l = $this->factory->get(Application::APP_ID, $languageCode); @@ -72,12 +73,12 @@ public function prepare(INotification $notification, string $languageCode): INot if (in_array($notification->getSubject(), ['success', 'failure'], true)) { // ignore old notifications (before meta tasks were introduced) if (!isset($params['target'], $params['inputs'])) { - throw new UnknownActivityException(); + throw new UnknownNotificationException(); } $schedulingAppId = $params['appId']; $schedulingAppInfo = $this->appManager->getAppInfo($schedulingAppId); if ($schedulingAppInfo === null) { - throw new UnknownActivityException(); + throw new UnknownNotificationException(); } $schedulingAppName = $schedulingAppInfo['name']; @@ -331,7 +332,7 @@ public function prepare(INotification $notification, string $languageCode): INot return $notification; default: // Unknown subject => Unknown notification => throw - throw new UnknownActivityException(); + throw new UnknownNotificationException(); } } } From 93a281de149f3236b3902ff152f0df8e4736aa70 Mon Sep 17 00:00:00 2001 From: Jana Peper Date: Tue, 26 May 2026 10:14:26 +0200 Subject: [PATCH 2/2] fix: cs fix Signed-off-by: Jana Peper --- lib/Notification/Notifier.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index b9197197..083c2f5b 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -8,7 +8,6 @@ namespace OCA\Assistant\Notification; use OCA\Assistant\AppInfo\Application; - use OCP\App\IAppManager; use OCP\IURLGenerator; use OCP\L10N\IFactory;