Skip to content

Commit da22791

Browse files
committed
Force Calendar Obejct Chnage Path to support public write
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 586cc9b commit da22791

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

apps/dav/lib/CalDAV/CalendarImpl.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ public function createFromString(string $name, string $calendarData): void {
154154
[, $user] = uriSplit($this->calendar->getPrincipalURI());
155155
$fullCalendarFilename = sprintf('calendars/%s/%s/%s', $user, $this->calendarInfo['uri'], $name);
156156

157+
// Force calendar change URI
158+
/** @var Schedule\Plugin $schedulingPlugin */
159+
$schedulingPlugin = $server->server->getPlugin('caldav-schedule');
160+
$schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename);
161+
157162
$stream = fopen('php://memory', 'rb+');
158163
fwrite($stream, $calendarData);
159164
rewind($stream);

apps/dav/lib/CalDAV/Schedule/Plugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ public function initialize(Server $server) {
8888
$server->on('afterCreateFile', [$this, 'dispatchSchedulingResponses']);
8989
}
9090

91+
/**
92+
* Allow manual setting of the object change URL
93+
* to support public write
94+
*
95+
* @param string $path
96+
*/
97+
public function setPathOfCalendarObjectChange(string $path): void {
98+
$this->pathOfCalendarObjectChange = $path;
99+
}
100+
91101
/**
92102
* This method handler is invoked during fetching of properties.
93103
*

0 commit comments

Comments
 (0)