From 7ebeed45bda44dabff20fba0e46b68eec627c3e0 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Sat, 7 Sep 2024 18:28:50 -0400 Subject: feat: add iMip Request Handling Signed-off-by: SebastianKrupinski --- apps/dav/lib/CalDAV/CachedSubscriptionImpl.php | 13 ++++++++++++- apps/dav/lib/CalDAV/CalendarImpl.php | 19 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php index 00fa90f5d20..4d25f5bb501 100644 --- a/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php +++ b/apps/dav/lib/CalDAV/CachedSubscriptionImpl.php @@ -9,9 +9,12 @@ declare(strict_types=1); namespace OCA\DAV\CalDAV; use OCP\Calendar\ICalendar; +use OCP\Calendar\ICalendarIsShared; +use OCP\Calendar\ICalendarIsWritable; use OCP\Constants; -class CachedSubscriptionImpl implements ICalendar { +class CachedSubscriptionImpl implements ICalendar, ICalendarIsShared, ICalendarIsWritable { + public function __construct( private CachedSubscription $calendar, /** @var array */ @@ -83,10 +86,18 @@ class CachedSubscriptionImpl implements ICalendar { return $result; } + public function isWritable(): bool { + return false; + } + public function isDeleted(): bool { return false; } + public function isShared(): bool { + return true; + } + public function getSource(): string { return $this->calendarInfo['source']; } diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index 85ca7f78ca4..919b08eefce 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -127,6 +127,13 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { return $result; } + /** + * @since 31.0.0 + */ + public function isWritable(): bool { + return $this->calendar->canWrite(); + } + /** * @since 26.0.0 */ @@ -134,6 +141,13 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { return $this->calendar->isDeleted(); } + /** + * @since 31.0.0 + */ + public function isShared(): bool { + return $this->calendar->isShared(); + } + /** * Create a new calendar event for this calendar * by way of an ICS string @@ -215,7 +229,10 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { $attendee = $vEvent->{'ATTENDEE'}->getValue(); $iTipMessage->method = $vObject->{'METHOD'}->getValue(); - if ($iTipMessage->method === 'REPLY') { + if ($iTipMessage->method === 'REQUEST') { + $iTipMessage->sender = $organizer; + $iTipMessage->recipient = $attendee; + } elseif ($iTipMessage->method === 'REPLY') { if ($server->isExternalAttendee($vEvent->{'ATTENDEE'}->getValue())) { $iTipMessage->recipient = $organizer; } else { -- cgit v1.2.3