diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-27 19:57:10 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-28 14:11:19 +0200 |
commit | 68fc9b48c24bf810488c5910da2feadd10587e51 (patch) | |
tree | cf183d9afa8f2fa5a9342341f4cf21d51bc6ad50 /apps/lookup_server_connector/lib | |
parent | 9bf812ac6c29f7722ba6db876dbabbc1b065dce1 (diff) | |
download | nextcloud-server-68fc9b48c24bf810488c5910da2feadd10587e51.tar.gz nextcloud-server-68fc9b48c24bf810488c5910da2feadd10587e51.zip |
feat!: Migrate AccountManager event to typed event
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/lookup_server_connector/lib')
-rw-r--r-- | apps/lookup_server_connector/lib/AppInfo/Application.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/lookup_server_connector/lib/AppInfo/Application.php b/apps/lookup_server_connector/lib/AppInfo/Application.php index 8d6700c0eaa..fbcf54f83de 100644 --- a/apps/lookup_server_connector/lib/AppInfo/Application.php +++ b/apps/lookup_server_connector/lib/AppInfo/Application.php @@ -30,6 +30,7 @@ namespace OCA\LookupServerConnector\AppInfo; use Closure; use OCA\LookupServerConnector\UpdateLookupServer; +use OCP\Accounts\UserUpdatedEvent; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; @@ -58,15 +59,10 @@ class Application extends App implements IBootstrap { */ private function registerEventListeners(IEventDispatcher $dispatcher, ContainerInterface $appContainer): void { - $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); - } + $dispatcher->addListener(UserUpdatedEvent::class, function (UserUpdatedEvent $event) use ($appContainer) { + /** @var UpdateLookupServer $updateLookupServer */ + $updateLookupServer = $appContainer->get(UpdateLookupServer::class); + $updateLookupServer->userUpdated($event->getUser()); }); } } |