aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorSebastianKrupinski <krupinskis05@gmail.com>2024-09-07 18:28:50 -0400
committerSebastianKrupinski <krupinskis05@gmail.com>2024-11-07 21:12:37 -0500
commit7ebeed45bda44dabff20fba0e46b68eec627c3e0 (patch)
treed3c027077167b54cdc18e4c42e7e1fc21a1dbbf6 /apps/dav/lib
parent3bd819745802ed0c1ab8a969db4acb051acfc0cf (diff)
downloadnextcloud-server-7ebeed45bda44dabff20fba0e46b68eec627c3e0.tar.gz
nextcloud-server-7ebeed45bda44dabff20fba0e46b68eec627c3e0.zip
feat: add iMip Request Handling
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/CachedSubscriptionImpl.php13
-rw-r--r--apps/dav/lib/CalDAV/CalendarImpl.php19
2 files changed, 30 insertions, 2 deletions
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<string, mixed> */
@@ -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
@@ -128,6 +128,13 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
}
/**
+ * @since 31.0.0
+ */
+ public function isWritable(): bool {
+ return $this->calendar->canWrite();
+ }
+
+ /**
* @since 26.0.0
*/
public function isDeleted(): bool {
@@ -135,6 +142,13 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
}
/**
+ * @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 {