88namespace OCA \Assistant \Notification ;
99
1010use OCA \Assistant \AppInfo \Application ;
11- use OCP \ Activity \ Exceptions \ UnknownActivityException ;
11+
1212use OCP \App \IAppManager ;
1313use OCP \IURLGenerator ;
1414use OCP \L10N \IFactory ;
1515use OCP \Notification \IAction ;
1616use OCP \Notification \INotification ;
1717
1818use OCP \Notification \INotifier ;
19+ use OCP \Notification \UnknownNotificationException ;
1920use OCP \TaskProcessing \IManager as ITaskProcessingManager ;
2021use OCP \TaskProcessing \TaskTypes \AudioToText ;
2122use OCP \TaskProcessing \TaskTypes \TextToImage ;
@@ -57,13 +58,13 @@ public function getName(): string {
5758 * @param INotification $notification
5859 * @param string $languageCode The code of the language that should be used to prepare the notification
5960 * @return INotification
60- * @throws UnknownActivityException When the notification was not prepared by a notifier
61+ * @throws UnknownNotificationException When the notification was not prepared by a notifier
6162 * @since 9.0.0
6263 */
6364 public function prepare (INotification $ notification , string $ languageCode ): INotification {
6465 if ($ notification ->getApp () !== Application::APP_ID ) {
6566 // Not my app => throw
66- throw new UnknownActivityException ();
67+ throw new UnknownNotificationException ();
6768 }
6869
6970 $ l = $ this ->factory ->get (Application::APP_ID , $ languageCode );
@@ -73,12 +74,12 @@ public function prepare(INotification $notification, string $languageCode): INot
7374 if (in_array ($ notification ->getSubject (), ['success ' , 'failure ' ], true )) {
7475 // ignore old notifications (before meta tasks were introduced)
7576 if (!isset ($ params ['target ' ], $ params ['inputs ' ])) {
76- throw new UnknownActivityException ();
77+ throw new UnknownNotificationException ();
7778 }
7879 $ schedulingAppId = $ params ['appId ' ];
7980 $ schedulingAppInfo = $ this ->appManager ->getAppInfo ($ schedulingAppId );
8081 if ($ schedulingAppInfo === null ) {
81- throw new UnknownActivityException ();
82+ throw new UnknownNotificationException ();
8283 }
8384 $ schedulingAppName = $ schedulingAppInfo ['name ' ];
8485
@@ -415,7 +416,7 @@ public function prepare(INotification $notification, string $languageCode): INot
415416
416417 default :
417418 // Unknown subject => Unknown notification => throw
418- throw new UnknownActivityException ();
419+ throw new UnknownNotificationException ();
419420 }
420421 }
421422}
0 commit comments