Skip to content

Commit

Permalink
get rid of getEventDispatcher()
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Sep 16, 2024
1 parent bbeb9be commit 1185a10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

use OC\User\Backend;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\NotPermittedException;
use OCP\IDBConnection;
use OCP\IGroupManager;
Expand All @@ -43,6 +44,7 @@ class UserBackend implements IUserBackend, UserInterface, ICountUsersBackend {
public function __construct(
private IDBConnection $db,
private ISession $session,
private IEventDispatcher $eventDispatcher,
private IGroupManager $groupManager,
private IUserManager $userManager
) {
Expand Down Expand Up @@ -107,9 +109,7 @@ public function createUserIfNotExists(string $uid): void {
}
// trigger any other initialization
$user = $this->userManager->get($uid);
\OC::$server->getEventDispatcher()->dispatch(
IUser::class . '::firstLogin', new GenericEvent($user)
);
$this->eventDispatcher->dispatch(IUser::class . '::firstLogin', new GenericEvent($user));
}
}

Expand Down

0 comments on commit 1185a10

Please sign in to comment.