diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-07 11:28:02 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-19 17:37:33 +0200 |
commit | 4877d0b62e1be0a3b726c901e9a1f986fa1a11c5 (patch) | |
tree | 1c5ae4ae2db52f44884b6051b83e04c99178c546 /apps | |
parent | a6bf93501deb1d2d01535e586388aeb5e6ee93f5 (diff) | |
download | nextcloud-server-4877d0b62e1be0a3b726c901e9a1f986fa1a11c5.tar.gz nextcloud-server-4877d0b62e1be0a3b726c901e9a1f986fa1a11c5.zip |
fix(loopup_server_connector): Migrate to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lookup_server_connector/lib/AppInfo/Application.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/lookup_server_connector/lib/AppInfo/Application.php b/apps/lookup_server_connector/lib/AppInfo/Application.php index edc2757c0a6..8d6700c0eaa 100644 --- a/apps/lookup_server_connector/lib/AppInfo/Application.php +++ b/apps/lookup_server_connector/lib/AppInfo/Application.php @@ -34,9 +34,9 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IUser; use Psr\Container\ContainerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\GenericEvent; class Application extends App implements IBootstrap { @@ -56,15 +56,17 @@ class Application extends App implements IBootstrap { /** * @todo move the OCP events and then move the registration to `register` */ - private function registerEventListeners(EventDispatcherInterface $dispatcher, + private function registerEventListeners(IEventDispatcher $dispatcher, ContainerInterface $appContainer): void { - $dispatcher->addListener('OC\AccountManager::userUpdated', function (GenericEvent $event) use ($appContainer) { - /** @var IUser $user */ - $user = $event->getSubject(); + $dispatcher->addListener('OC\AccountManager::userUpdated', function ($event) use ($appContainer) { + if ($event instanceof GenericEvent) { + /** @var IUser $user */ + $user = $event->getSubject(); - /** @var UpdateLookupServer $updateLookupServer */ - $updateLookupServer = $appContainer->get(UpdateLookupServer::class); - $updateLookupServer->userUpdated($user); + /** @var UpdateLookupServer $updateLookupServer */ + $updateLookupServer = $appContainer->get(UpdateLookupServer::class); + $updateLookupServer->userUpdated($user); + } }); } } |