Skip to content

Commit

Permalink
delete birthday calendar events permanently
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Martin <maximilian_martin@gmx.de>
  • Loading branch information
max65482 authored and come-nc committed Feb 17, 2022
1 parent bab0881 commit e8ef4ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/dav/lib/CalDAV/BirthdayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function onCardDeleted(int $addressBookId,
$calendar = $this->ensureCalendarExists($principalUri);
foreach (['', '-death', '-anniversary'] as $tag) {
$objectUri = $book['uri'] . '-' . $cardUri . $tag .'.ics';
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri);
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true);
}
}
}
Expand Down Expand Up @@ -306,7 +306,7 @@ public function resetForUser(string $user):void {
$calendarObjects = $this->calDavBackEnd->getCalendarObjects($calendar['id'], CalDavBackend::CALENDAR_TYPE_CALENDAR);

foreach ($calendarObjects as $calendarObject) {
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $calendarObject['uri'], CalDavBackend::CALENDAR_TYPE_CALENDAR);
$this->calDavBackEnd->deleteCalendarObject($calendar['id'], $calendarObject['uri'], CalDavBackend::CALENDAR_TYPE_CALENDAR, true);
}
}

Expand Down Expand Up @@ -384,7 +384,7 @@ private function updateCalendar(string $cardUri,
$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
if ($calendarData === null) {
if ($existing !== null) {
$this->calDavBackEnd->deleteCalendarObject($calendarId, $objectUri);
$this->calDavBackEnd->deleteCalendarObject($calendarId, $objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true);
}
} else {
if ($existing === null) {
Expand All @@ -398,7 +398,7 @@ private function updateCalendar(string $cardUri,
if ($existing2path !== null && array_key_exists('uri', $calendarInfo)) {
// delete the old birthday entry first so that we do not get duplicate UIDs
$existing2objectUri = substr($existing2path, strlen($calendarInfo['uri']) + 1);
$this->calDavBackEnd->deleteCalendarObject($calendarId, $existing2objectUri);
$this->calDavBackEnd->deleteCalendarObject($calendarId, $existing2objectUri, CalDavBackend::CALENDAR_TYPE_CALENDAR, true);
}
}

Expand Down

0 comments on commit e8ef4ca

Please sign in to comment.