diff options
author | Anna Larch <anna@nextcloud.com> | 2025-07-17 14:19:29 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-07-28 10:18:48 +0000 |
commit | 4d3c5ebfefd12d0946605bd74708f0a9597f5f97 (patch) | |
tree | 0d38380ba0ee6e9223e5ec59f10ed6cb762aeaa0 | |
parent | b0953333be416cb002f04146342a92bd53d00d79 (diff) | |
download | nextcloud-server-backport/53992/stable30.tar.gz nextcloud-server-backport/53992/stable30.zip |
fix(caldav): don't return cancelled events for upcoming events APIbackport/53992/stable30
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r-- | apps/dav/lib/CalDAV/UpcomingEventsService.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/UpcomingEventsService.php b/apps/dav/lib/CalDAV/UpcomingEventsService.php index 3925cba9203..404f368826b 100644 --- a/apps/dav/lib/CalDAV/UpcomingEventsService.php +++ b/apps/dav/lib/CalDAV/UpcomingEventsService.php @@ -45,7 +45,7 @@ class UpcomingEventsService { $this->userManager->get($userId), ); - return array_map(function (array $event) use ($userId, $calendarAppEnabled) { + return array_filter(array_map(function (array $event) use ($userId, $calendarAppEnabled) { $calendarAppUrl = null; if ($calendarAppEnabled) { @@ -65,6 +65,10 @@ class UpcomingEventsService { $calendarAppUrl = $this->urlGenerator->linkToRouteAbsolute('calendar.view.indexdirect.edit', $arguments); } + if (isset($event['objects'][0]['STATUS']) && $event['objects'][0]['STATUS'][0] === 'CANCELLED') { + return false; + } + return new UpcomingEvent( $event['uri'], ($event['objects'][0]['RECURRENCE-ID'][0] ?? null)?->getTimeStamp(), @@ -74,7 +78,7 @@ class UpcomingEventsService { $event['objects'][0]['LOCATION'][0] ?? null, $calendarAppUrl, ); - }, $events); + }, $events)); } } |