Skip to content

Commit 03a300c

Browse files
committed
fix(dav): fix event birthday alarms not being updated
In #33251 the default offset for a birthday event alarm was changed to 9AM on the day of the event. However the birthdayEvenChanged method did not account for alarm changes, so it was never propagated to existing birthday events, which were kept on midnight. Signed-off-by: Thomas Citharel <[email protected]>
1 parent c3267a7 commit 03a300c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/dav/lib/CalDAV/BirthdayService.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ public function syncUser(string $user):void {
317317
}
318318

319319
/**
320+
* The birthday event is considered changed if either
321+
* - the start date has changed
322+
* - the title has changed
323+
* - the time for the alarm has changed
324+
*
320325
* @param string $existingCalendarData
321326
* @param VCalendar $newCalendarData
322327
* @return bool
@@ -331,7 +336,8 @@ public function birthdayEvenChanged(string $existingCalendarData,
331336

332337
return (
333338
$newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() ||
334-
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue()
339+
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue() ||
340+
($newCalendarData->VEVENT->VALARM && $existingBirthday->VEVENT->VALARM && $newCalendarData->VEVENT->VALARM->TRIGGER->getValue() !== $existingBirthday->VEVENT->VALARM->TRIGGER->getValue())
335341
);
336342
}
337343

0 commit comments

Comments
 (0)