Skip to content

Commit

Permalink
fix(dav): fix event birthday alarms not being updated
Browse files Browse the repository at this point in the history
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 <tcit@tcit.fr>
  • Loading branch information
tcitworld authored and miaulalala committed Aug 28, 2023
1 parent ce9e0ae commit f3ccb5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/dav/lib/CalDAV/BirthdayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
);
}

Expand Down

0 comments on commit f3ccb5d

Please sign in to comment.