fix: add missing listener
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>pull/54805/head
parent
47362fa87e
commit
6825548de3
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\ContactsInteraction\Listeners;
|
||||
|
||||
use OCA\ContactsInteraction\Db\RecentContactMapper;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use OCP\User\Events\UserDeletedEvent;
|
||||
|
||||
/**
|
||||
* @template-implements IEventListener<Event|UserDeletedEvent>
|
||||
*/
|
||||
class UserDeletedListener implements IEventListener {
|
||||
|
||||
public function __construct(
|
||||
private RecentContactMapper $recentContactMapper,
|
||||
) {
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function handle(Event $event): void {
|
||||
if (!($event instanceof UserDeletedEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->recentContactMapper->deleteByUserId($event->getUser()->getUID());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue