diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-19 21:56:34 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-25 11:19:26 +0200 |
commit | 77bc6c32d8b7cfe65f6a0e4ba303997a22f075d7 (patch) | |
tree | 30c9d215b79d0c21ba7ecac0b5fb94865fec2863 /apps/files_sharing/lib | |
parent | 43ab741f9cc252ac48612f586b0d545c0c253e5c (diff) | |
download | nextcloud-server-77bc6c32d8b7cfe65f6a0e4ba303997a22f075d7.tar.gz nextcloud-server-77bc6c32d8b7cfe65f6a0e4ba303997a22f075d7.zip |
fix(dispatcher): Move remaining simple cases in apps/ folder to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/AppInfo/Application.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 946d82a3df7..65197e9b270 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -51,7 +51,6 @@ use OCA\Files_Sharing\Notification\Listener; use OCA\Files_Sharing\Notification\Notifier; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files\Event\LoadSidebar; -use OCP\Files\Event\BeforeDirectGetEvent; use OCA\Files_Sharing\ShareBackend\File; use OCA\Files_Sharing\ShareBackend\Folder; use OCA\Files_Sharing\ViewOnly; @@ -61,7 +60,6 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent; use OCP\EventDispatcher\IEventDispatcher; -use OCP\EventDispatcher\GenericEvent; use OCP\Federation\ICloudIdManager; use OCP\Files\Config\IMountProviderCollection; use OCP\Files\Events\BeforeDirectFileDownloadEvent; @@ -72,13 +70,10 @@ use OCP\Group\Events\UserAddedEvent; use OCP\IDBConnection; use OCP\IGroup; use OCP\IUserSession; -use OCP\L10N\IFactory; use OCP\Share\Events\ShareCreatedEvent; -use OCP\Share\IManager; use OCP\User\Events\UserChangedEvent; use OCP\Util; use Psr\Container\ContainerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent as OldGenericEvent; class Application extends App implements IBootstrap { @@ -135,7 +130,7 @@ class Application extends App implements IBootstrap { $mountProviderCollection->registerProvider($externalMountProvider); } - public function registerEventsScripts(IEventDispatcher $dispatcher, EventDispatcherInterface $oldDispatcher): void { + public function registerEventsScripts(IEventDispatcher $dispatcher): void { // sidebar and files scripts $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalListener::class); $dispatcher->addServiceListener(BeforeTemplateRenderedEvent::class, LegacyBeforeTemplateRenderedListener::class); @@ -148,12 +143,18 @@ class Application extends App implements IBootstrap { }); // notifications api to accept incoming user shares - $oldDispatcher->addListener('OCP\Share::postShare', function (OldGenericEvent $event) { + $dispatcher->addListener('OCP\Share::postShare', function ($event) { + if (!$event instanceof OldGenericEvent) { + return; + } /** @var Listener $listener */ $listener = $this->getContainer()->query(Listener::class); $listener->shareNotification($event); }); - $oldDispatcher->addListener(IGroup::class . '::postAddUser', function (OldGenericEvent $event) { + $dispatcher->addListener(IGroup::class . '::postAddUser', function ($event) { + if (!$event instanceof OldGenericEvent) { + return; + } /** @var Listener $listener */ $listener = $this->getContainer()->query(Listener::class); $listener->userAddedToGroup($event); |