aboutsummaryrefslogtreecommitdiffstats
path: root/apps/lookup_server_connector/lib/AppInfo/Application.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/lookup_server_connector/lib/AppInfo/Application.php')
-rw-r--r--apps/lookup_server_connector/lib/AppInfo/Application.php42
1 files changed, 9 insertions, 33 deletions
diff --git a/apps/lookup_server_connector/lib/AppInfo/Application.php b/apps/lookup_server_connector/lib/AppInfo/Application.php
index 806f3e327aa..4a43e925970 100644
--- a/apps/lookup_server_connector/lib/AppInfo/Application.php
+++ b/apps/lookup_server_connector/lib/AppInfo/Application.php
@@ -3,41 +3,20 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019 Joas Schilling <coding@schilljs.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
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;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
-use OCP\AppFramework\IAppContainer;
-use OCP\IUser;
-use Symfony\Component\EventDispatcher\EventDispatcher;
-use Symfony\Component\EventDispatcher\GenericEvent;
+use OCP\EventDispatcher\IEventDispatcher;
+use Psr\Container\ContainerInterface;
class Application extends App implements IBootstrap {
public const APP_ID = 'lookup_server_connector';
@@ -56,15 +35,12 @@ class Application extends App implements IBootstrap {
/**
* @todo move the OCP events and then move the registration to `register`
*/
- private function registerEventListeners(EventDispatcher $dispatcher,
- IAppContainer $appContainer): void {
- $dispatcher->addListener('OC\AccountManager::userUpdated', function (GenericEvent $event) use ($appContainer) {
- /** @var IUser $user */
- $user = $event->getSubject();
-
+ private function registerEventListeners(IEventDispatcher $dispatcher,
+ ContainerInterface $appContainer): void {
+ $dispatcher->addListener(UserUpdatedEvent::class, function (UserUpdatedEvent $event) use ($appContainer): void {
/** @var UpdateLookupServer $updateLookupServer */
$updateLookupServer = $appContainer->get(UpdateLookupServer::class);
- $updateLookupServer->userUpdated($user);
+ $updateLookupServer->userUpdated($event->getUser());
});
}
}