Skip to content

Commit

Permalink
Merge pull request #159 from nextcloud/fix/noid/deprecated-event-disp…
Browse files Browse the repository at this point in the history
…atcher

get rid of getEventDispatcher()
  • Loading branch information
ArtificialOwl authored Sep 16, 2024
2 parents bbeb9be + 1185a10 commit 56fa23d
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 56fa23d

Please sign in to comment.