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 ;
1717use OCP \Notification \INotifier ;
18+ use OCP \Notification \UnknownNotificationException ;
1819use OCP \TaskProcessing \IManager as ITaskProcessingManager ;
1920use OCP \TaskProcessing \TaskTypes \AudioToText ;
2021use OCP \TaskProcessing \TaskTypes \TextToImage ;
@@ -56,13 +57,13 @@ public function getName(): string {
5657 * @param INotification $notification
5758 * @param string $languageCode The code of the language that should be used to prepare the notification
5859 * @return INotification
59- * @throws UnknownActivityException When the notification was not prepared by a notifier
60+ * @throws UnknownNotificationException When the notification was not prepared by a notifier
6061 * @since 9.0.0
6162 */
6263 public function prepare (INotification $ notification , string $ languageCode ): INotification {
6364 if ($ notification ->getApp () !== Application::APP_ID ) {
6465 // Not my app => throw
65- throw new UnknownActivityException ();
66+ throw new UnknownNotificationException ();
6667 }
6768
6869 $ l = $ this ->factory ->get (Application::APP_ID , $ languageCode );
@@ -72,12 +73,12 @@ public function prepare(INotification $notification, string $languageCode): INot
7273 if (in_array ($ notification ->getSubject (), ['success ' , 'failure ' ], true )) {
7374 // ignore old notifications (before meta tasks were introduced)
7475 if (!isset ($ params ['target ' ], $ params ['inputs ' ])) {
75- throw new UnknownActivityException ();
76+ throw new UnknownNotificationException ();
7677 }
7778 $ schedulingAppId = $ params ['appId ' ];
7879 $ schedulingAppInfo = $ this ->appManager ->getAppInfo ($ schedulingAppId );
7980 if ($ schedulingAppInfo === null ) {
80- throw new UnknownActivityException ();
81+ throw new UnknownNotificationException ();
8182 }
8283 $ schedulingAppName = $ schedulingAppInfo ['name ' ];
8384
@@ -331,7 +332,7 @@ public function prepare(INotification $notification, string $languageCode): INot
331332 return $ notification ;
332333 default :
333334 // Unknown subject => Unknown notification => throw
334- throw new UnknownActivityException ();
335+ throw new UnknownNotificationException ();
335336 }
336337 }
337338}
0 commit comments