diff options
author | Anna Larch <anna@nextcloud.com> | 2025-07-17 14:19:29 +0200 |
---|---|---|
committer | Anna <anna@nextcloud.com> | 2025-07-17 16:37:42 +0200 |
commit | 35cf5e49dafe0d669d2c21be6f896e93df5ccd2c (patch) | |
tree | 655e39e2449ce29da1fc3b310d848a4cd56edad7 | |
parent | 2cbfdcc4932857cc9f335aab86b37cc31cfa863a (diff) | |
download | nextcloud-server-fix/noid/filter-cancelled-events.tar.gz nextcloud-server-fix/noid/filter-cancelled-events.zip |
fix(caldav): don't return cancelled events for upcoming events APIfix/noid/filter-cancelled-events
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 6614d937ff7..ce67b72104e 100644 --- a/apps/dav/lib/CalDAV/UpcomingEventsService.php +++ b/apps/dav/lib/CalDAV/UpcomingEventsService.php @@ -47,7 +47,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) { @@ -67,6 +67,10 @@ class UpcomingEventsService { $calendarAppUrl = $this->urlGenerator->linkToRouteAbsolute('calendar.view.indexdirect.edit', $arguments); } + if ($event['objects'][0]['STATUS'][0] === 'CANCELLED') { + return false; + } + return new UpcomingEvent( $event['uri'], ($event['objects'][0]['RECURRENCE-ID'][0] ?? null)?->getTimeStamp(), @@ -76,7 +80,7 @@ class UpcomingEventsService { $event['objects'][0]['LOCATION'][0] ?? null, $calendarAppUrl, ); - }, $events); + }, $events)); } } |