From 8939a2edcd10ec79c11f62cd6e993c960b62fa2e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 19 Aug 2023 11:43:10 +0200 Subject: [PATCH] fix(dav): fix event birthday alarms not being updated In https://github.com/nextcloud/server/pull/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 --- apps/dav/lib/CalDAV/BirthdayService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 95176283f11..a34b5e0d331 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -317,6 +317,11 @@ class BirthdayService { } /** + * The birthday event is considered changed if either + * - the start date has changed + * - the title has changed + * - the time for the alarm has changed + * * @param string $existingCalendarData * @param VCalendar $newCalendarData * @return bool @@ -331,7 +336,8 @@ class BirthdayService { return ( $newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() || - $newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue() + $newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue() || + ($newCalendarData->VEVENT->VALARM && $existingBirthday->VEVENT->VALARM && $newCalendarData->VEVENT->VALARM->TRIGGER->getValue() !== $existingBirthday->VEVENT->VALARM->TRIGGER->getValue()) ); }