2626use  OCA \Comments \Controller \Notifications ;
2727use  OCA \Comments \EventHandler ;
2828use  OCA \Comments \JSSettingsHelper ;
29+ use  OCA \Comments \Listener \LoadAdditionalScripts ;
2930use  OCA \Comments \Notification \Notifier ;
3031use  OCA \Comments \Search \Provider ;
32+ use  OCA \Files \Event \LoadAdditionalScriptsEvent ;
3133use  OCP \AppFramework \App ;
3234use  OCP \Comments \CommentsEntityEvent ;
35+ use  OCP \EventDispatcher \IEventDispatcher ;
3336use  OCP \Util ;
3437use  Symfony \Component \EventDispatcher \EventDispatcherInterface ;
3538
@@ -48,7 +51,8 @@ public function __construct (array $urlParams = array()) {
4851	public  function  register () {
4952		$ server$ this getContainer ()->getServer ();
5053
51- 		$ dispatcher$ servergetEventDispatcher ();
54+ 		/** @var IEventDispatcher $newDispatcher */ 
55+ 		$ dispatcher$ serverquery (IEventDispatcher::class);
5256		$ this registerSidebarScripts ($ dispatcher
5357		$ this registerDavEntity ($ dispatcher
5458		$ this registerNotifier ();
@@ -57,16 +61,11 @@ public function register() {
5761		$ servergetSearch ()->registerProvider (Provider::class, ['apps '  => ['files ' ]]);
5862	}
5963
60- 	protected  function  registerSidebarScripts (EventDispatcherInterface $ dispatcher
61- 		$ dispatcheraddListener (
62- 			'OCA\Files::loadAdditionalScripts ' ,
63- 			function () {
64- 				Util::addScript ('comments ' , 'comments ' );
65- 			}
66- 		);
64+ 	protected  function  registerSidebarScripts (IEventDispatcher $ dispatcher
65+ 		$ dispatcheraddServiceListener (LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class);
6766	}
6867
69- 	protected  function  registerDavEntity (EventDispatcherInterface $ dispatcher
68+ 	protected  function  registerDavEntity (IEventDispatcher $ dispatcher
7069		$ dispatcheraddListener (CommentsEntityEvent::EVENT_ENTITY , function (CommentsEntityEvent $ event
7170			$ eventaddEntityCollection ('files ' , function ($ name
7271				$ nodesOC ::$ servergetUserFolder ()->getById ((int )$ name
0 commit comments