|
8 | 8 | namespace OCA\Recognize\AppInfo; |
9 | 9 |
|
10 | 10 | use OCA\DAV\Connector\Sabre\Principal; |
| 11 | +use OCA\DAV\Events\SabrePluginAddEvent; |
11 | 12 | use OCA\Recognize\Dav\Faces\PropFindPlugin; |
12 | 13 | use OCA\Recognize\Hooks\FileListener; |
13 | 14 | use OCP\AppFramework\App; |
|
22 | 23 | use OCP\Files\Events\Node\NodeDeletedEvent; |
23 | 24 | use OCP\Files\Events\Node\NodeRenamedEvent; |
24 | 25 | use OCP\Files\Events\NodeRemovedFromCache; |
25 | | -use OCP\SabrePluginEvent; |
26 | 26 |
|
27 | 27 | final class Application extends App implements IBootstrap { |
28 | 28 | public const APP_ID = 'recognize'; |
@@ -60,15 +60,13 @@ public function register(IRegistrationContext $context): void { |
60 | 60 | */ |
61 | 61 | public function boot(IBootContext $context): void { |
62 | 62 | $eventDispatcher = \OCP\Server::get(IEventDispatcher::class); |
63 | | - $eventDispatcher->addListener('OCA\DAV\Connector\Sabre::addPlugin', function (SabrePluginEvent $event): void { |
| 63 | + $eventDispatcher->addListener(SabrePluginAddEvent::class, function (SabrePluginAddEvent $event): void { |
64 | 64 | $server = $event->getServer(); |
65 | 65 |
|
66 | | - if ($server !== null) { |
67 | | - // We have to register the PropFindPlugin here and not info.xml, |
68 | | - // because info.xml plugins are loaded, after the |
69 | | - // beforeMethod:* hook has already been emitted. |
70 | | - $server->addPlugin($this->getContainer()->get(PropFindPlugin::class)); |
71 | | - } |
| 66 | + // We have to register the PropFindPlugin here and not info.xml, |
| 67 | + // because info.xml plugins are loaded, after the |
| 68 | + // beforeMethod:* hook has already been emitted. |
| 69 | + $server->addPlugin($this->getContainer()->get(PropFindPlugin::class)); |
72 | 70 | }); |
73 | 71 | } |
74 | 72 | } |
0 commit comments