From 8e7bf7a13af8127826e0dca08c6f513461f16687 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 70b2e859f89a4..002a3c006bddc 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -317,6 +317,11 @@ public function syncUser(string $user):void { } /** + * 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 @@ public function birthdayEvenChanged(string $existingCalendarData, 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()) ); }