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 <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-08-19 11:43:10 +02:00
parent 937a6a84fe
commit 8939a2edcd
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -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())
);
}