File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,12 +212,32 @@ private function parseUpgrade(
212212 INotification $ notification ,
213213 IL10N $ l ,
214214 ): INotification {
215+
215216 $ parameters = $ notification ->getSubjectParameters ();
216217 $ notification ->setIcon ($ this ->url ->getAbsoluteURL ($ this ->url ->imagePath (Application::APP_ID , 'app-dark.svg ' )));
217218 $ subject = $ l ->t ('LibreSign has been updated! ' );
218219 $ message = $ parameters ['message ' ] ?? '' ;
219220 $ notification ->setParsedSubject ($ subject )
220221 ->setParsedMessage ($ message );
222+
223+ $ dismissAction = $ notification ->createAction ()
224+ ->setParsedLabel ($ l ->t ('Dismiss notification ' ))
225+ ->setPrimary (false )
226+ ->setLink (
227+ $ this ->url ->linkToOCSRouteAbsolute (
228+ 'libresign.notify.notificationDismiss ' ,
229+ [
230+ 'apiVersion ' => 'v1 ' ,
231+ 'timestamp ' => $ notification ->getDateTime ()->getTimestamp (),
232+ 'objectType ' => 'upgrade ' ,
233+ 'objectId ' => '1 ' ,
234+ 'subject ' => 'libresign_upgrade ' ,
235+ ],
236+ ),
237+ IAction::TYPE_DELETE
238+ );
239+ $ notification ->addParsedAction ($ dismissAction );
240+
221241 return $ notification ;
222242 }
223243}
You can’t perform that action at this time.
0 commit comments