Skip to content

Commit 6b7e212

Browse files
committed
fix(ICalendar): allow to search for event URI
Signed-off-by: Jonas <jonas@freesources.org>
1 parent cde3780 commit 6b7e212

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

apps/dav/lib/CalDAV/CalDavBackend.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,10 @@ public function search(
20622062
$outerQuery->andWhere($outerQuery->expr()->eq('uid', $outerQuery->createNamedParameter($options['uid'])));
20632063
}
20642064

2065+
if (isset($options['uri'])) {
2066+
$outerQuery->andWhere($outerQuery->expr()->eq('uri', $outerQuery->createNamedParameter($options['uri'])));
2067+
}
2068+
20652069
if (!empty($options['types'])) {
20662070
$or = [];
20672071
foreach ($options['types'] as $type) {

lib/public/Calendar/ICalendar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @psalm-type CalendarSearchOptions = array{
1919
* timerange?: array{start?: DateTimeInterface, end?: DateTimeInterface},
2020
* uid?: string,
21+
* uri?: string,
2122
* types?: string[],
2223
* }
2324
*/
@@ -60,6 +61,7 @@ public function getDisplayColor(): ?string;
6061
* @param array $options Optional parameters for the search:
6162
* - 'timerange' element that can have 'start' (DateTimeInterface), 'end' (DateTimeInterface), or both.
6263
* - 'uid' element to look for events with a given uid.
64+
* - 'uri' element to look for events with a given uri.
6365
* - 'types' element to only return events for a given type (e.g. VEVENT or VTODO)
6466
* @psalm-param CalendarSearchOptions $options
6567
* @param int|null $limit Limit the number of search results.

0 commit comments

Comments
 (0)