Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: delete UserStatusAutomation when user is deleted
Signed-off-by: Salvatore Martire <[email protected]>
  • Loading branch information
salmart-dev committed Jul 1, 2025
commit 125696bfbcd0364fd66d48a35508545426138fd0
5 changes: 5 additions & 0 deletions apps/dav/lib/Listener/UserEventsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@

namespace OCA\DAV\Listener;

use OCA\DAV\BackgroundJob\UserStatusAutomation;
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\CardDAV\SyncService;
use OCA\DAV\Service\ExampleContactService;
use OCA\DAV\Service\ExampleEventService;
use OCP\Accounts\UserUpdatedEvent;
use OCP\BackgroundJob\IJobList;
use OCP\Defaults;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
Expand Down Expand Up @@ -49,6 +51,7 @@ public function __construct(
private ExampleContactService $exampleContactService,
private ExampleEventService $exampleEventService,
private LoggerInterface $logger,
private IJobList $jobList,
) {
}

Expand Down Expand Up @@ -124,6 +127,8 @@ public function postDeleteUser(string $uid): void {
$this->cardDav->deleteAddressBook($addressBook['id']);
}

$this->jobList->remove(UserStatusAutomation::class, ['userId' => $uid]);

unset($this->calendarsToDelete[$uid]);
unset($this->subscriptionsToDelete[$uid]);
unset($this->addressBooksToDelete[$uid]);
Expand Down