diff options
author | Anna Larch <anna@nextcloud.com> | 2024-05-08 15:12:17 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-05-14 13:34:01 +0000 |
commit | 19f95cd10db89f3f6e1c5557f145490d06149729 (patch) | |
tree | 07d8dcbbaedc91e19f51c0f10955ac5e3f90c811 /apps/dav/lib | |
parent | 7101ae8eab3a23b2af1d201d2fd06e1e5a08a7f0 (diff) | |
download | nextcloud-server-19f95cd10db89f3f6e1c5557f145490d06149729.tar.gz nextcloud-server-19f95cd10db89f3f6e1c5557f145490d06149729.zip |
fix(caldav): loop through all events for busy events
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/CalendarObject.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarObject.php b/apps/dav/lib/CalDAV/CalendarObject.php index 0d82e5ffa76..fc2b65f3efe 100644 --- a/apps/dav/lib/CalDAV/CalendarObject.php +++ b/apps/dav/lib/CalDAV/CalendarObject.php @@ -97,19 +97,16 @@ class CalendarObject extends \Sabre\CalDAV\CalendarObject { * @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) { |