mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
Move event listener registration to register()
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
2e52e39aff
commit
4f2048851c
1 changed files with 8 additions and 12 deletions
|
|
@ -115,6 +115,7 @@ class Application extends App implements IBootstrap {
|
|||
// the instance is specific to a lazy bound Access instance, thus cannot be shared.
|
||||
false
|
||||
);
|
||||
$context->registerEventListener(PostLoginEvent::class, FirstLoginListener::class);
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
|
|
@ -144,7 +145,6 @@ class Application extends App implements IBootstrap {
|
|||
});
|
||||
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerBackendDependents']));
|
||||
$context->injectFn(Closure::fromCallable([$this, 'registerFirstLoginListener']));
|
||||
|
||||
\OCP\Util::connectHook(
|
||||
'\OCA\Files_Sharing\API\Server2Server',
|
||||
|
|
@ -152,9 +152,15 @@ class Application extends App implements IBootstrap {
|
|||
'\OCA\User_LDAP\Helper',
|
||||
'loginName2UserName'
|
||||
);
|
||||
\OCP\Util::connectHook(
|
||||
'\OC\User',
|
||||
'assignedUserId',
|
||||
FirstLoginListener::class,
|
||||
'onAssignedId'
|
||||
);
|
||||
}
|
||||
|
||||
private function registerBackendDependents(IAppContainer $appContainer, IEventDispatcher $dispatcher) {
|
||||
private function registerBackendDependents(IAppContainer $appContainer, IEventDispatcher $dispatcher): void {
|
||||
$dispatcher->addListener(
|
||||
'OCA\\Files_External::loadAdditionalBackends',
|
||||
function () use ($appContainer) {
|
||||
|
|
@ -165,14 +171,4 @@ class Application extends App implements IBootstrap {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
private function registerFirstLoginListener(IEventDispatcher $dispatcher) {
|
||||
$dispatcher->addServiceListener(PostLoginEvent::class, FirstLoginListener::class);
|
||||
\OCP\Util::connectHook(
|
||||
'\OC\User',
|
||||
'assignedUserId',
|
||||
FirstLoginListener::class,
|
||||
'onAssignedId'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue