88
99namespace OCA \Polls \Provider ;
1010
11- use InvalidArgumentException ;
1211use OCA \Polls \AppConstants ;
1312use OCA \Polls \Db \ShareMapper ;
1413use OCA \Polls \Db \UserMapper ;
1514use OCA \Polls \Model \UserBase ;
1615use OCA \Polls \Service \ActivityService ;
16+ use OCP \Activity \Exceptions \UnknownActivityException ;
1717use OCP \Activity \IEvent ;
1818use OCP \Activity \IEventMerger ;
1919use OCP \Activity \IManager as ActivityManager ;
2222use OCP \IURLGenerator ;
2323use OCP \L10N \IFactory ;
2424
25+
2526/**
2627 * @psalm-suppress UnusedClass
2728 */
@@ -40,14 +41,14 @@ public function __construct(
4041
4142 public function parse ($ language , IEvent $ event , ?IEvent $ previousEvent = null ) {
4243 if ($ event ->getApp () !== AppConstants::APP_ID ) {
43- throw new \ InvalidArgumentException ();
44+ throw new UnknownActivityException ();
4445 }
4546
4647 $ this ->l10n = $ this ->transFactory ->get ($ event ->getApp (), $ language );
4748 $ event ->setIcon ($ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->imagePath ($ event ->getApp (), 'polls-dark.svg ' )));
4849 $ subject = $ this ->activityService ->getActivityMessage ($ event , $ language , $ this ->activityManager ->isFormattingFilteredObject ());
4950 if (!$ subject ) {
50- throw new InvalidArgumentException ();
51+ throw new UnknownActivityException ();
5152 }
5253 $ this ->setSubjects ($ event , $ subject );
5354 return $ event ;
0 commit comments