Skip to content

Commit

Permalink
Merge pull request #45313 from nextcloud/backport/45309/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(caldav): loop through all events for busy events
  • Loading branch information
miaulalala authored May 15, 2024
2 parents cb63ff8 + 21dd449 commit 6ee58b0
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,16 @@ protected function isShared() {
* @param Component\VCalendar $vObject
* @return void
*/
private function createConfidentialObject(Component\VCalendar $vObject) {
private function createConfidentialObject(Component\VCalendar $vObject): void {
/** @var Component $vElement */
$vElement = null;
if (isset($vObject->VEVENT)) {
$vElement = $vObject->VEVENT;
}
if (isset($vObject->VJOURNAL)) {
$vElement = $vObject->VJOURNAL;
}
if (isset($vObject->VTODO)) {
$vElement = $vObject->VTODO;
}
if (!is_null($vElement)) {
$vElements = array_filter($vObject->getComponents(), static function ($vElement) {
return $vElement instanceof Component\VEvent || $vElement instanceof Component\VJournal || $vElement instanceof Component\VTodo;
});

foreach ($vElements as $vElement) {
if (empty($vElement->select('SUMMARY'))) {
$vElement->add('SUMMARY', $this->l10n->t('Busy')); // This is needed to mask "Untitled Event" events
}
foreach ($vElement->children() as &$property) {
/** @var Property $property */
switch ($property->name) {
Expand Down

0 comments on commit 6ee58b0

Please sign in to comment.