|
9 | 9 |
|
10 | 10 | use Exception; |
11 | 11 | use OC\Files\Filesystem; |
| 12 | +use OCA\DAV\Events\SabrePluginAddEvent; |
12 | 13 | use OCA\Registration\Events\PassedFormEvent; |
13 | 14 | use OCA\Registration\Events\ShowFormEvent; |
14 | 15 | use OCA\Registration\Events\ValidateFormEvent; |
|
30 | 31 | use OCP\IUser; |
31 | 32 | use OCP\IUserSession; |
32 | 33 | use OCP\Notification\IManager; |
33 | | -use OCP\SabrePluginEvent; |
34 | 34 | use OCP\User\Events\UserDeletedEvent; |
35 | 35 | use OCP\User\Events\UserFirstTimeLoggedInEvent; |
36 | 36 | use OCP\Util; |
@@ -61,16 +61,14 @@ public function boot(IBootContext $context): void { |
61 | 61 | Util::connectHook('OC_Filesystem', 'preSetup', $this, 'addStorageWrapper'); |
62 | 62 |
|
63 | 63 | $eventDispatcher = $context->getServerContainer()->get(IEventDispatcher::class); |
64 | | - $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function (SabrePluginEvent $event) use ($context): void { |
| 64 | + $eventDispatcher->addListener(SabrePluginAddEvent::class, function (SabrePluginAddEvent $event) use ($context): void { |
65 | 65 | $eventServer = $event->getServer(); |
66 | 66 |
|
67 | | - if ($eventServer !== null) { |
68 | | - // We have to register the CheckPlugin here and not info.xml, |
69 | | - // because info.xml plugins are loaded, after the |
70 | | - // beforeMethod:* hook has already been emitted. |
71 | | - $plugin = $context->getAppContainer()->get(CheckPlugin::class); |
72 | | - $eventServer->addPlugin($plugin); |
73 | | - } |
| 67 | + // We have to register the CheckPlugin here and not info.xml, |
| 68 | + // because info.xml plugins are loaded, after the |
| 69 | + // beforeMethod:* hook has already been emitted. |
| 70 | + $plugin = $context->getAppContainer()->get(CheckPlugin::class); |
| 71 | + $eventServer->addPlugin($plugin); |
74 | 72 | }); |
75 | 73 |
|
76 | 74 | $context->injectFn($this->registerNotifier(...)); |
|
0 commit comments