Skip to content

Commit

Permalink
Merge pull request #29594 from nextcloud/fix/force-calendar-object-ch…
Browse files Browse the repository at this point in the history
…ange-path
  • Loading branch information
skjnldsv authored Nov 8, 2021
2 parents 586cc9b + da22791 commit c9421e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/dav/lib/CalDAV/CalendarImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public function createFromString(string $name, string $calendarData): void {
[, $user] = uriSplit($this->calendar->getPrincipalURI());
$fullCalendarFilename = sprintf('calendars/%s/%s/%s', $user, $this->calendarInfo['uri'], $name);

// Force calendar change URI
/** @var Schedule\Plugin $schedulingPlugin */
$schedulingPlugin = $server->server->getPlugin('caldav-schedule');
$schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename);

$stream = fopen('php://memory', 'rb+');
fwrite($stream, $calendarData);
rewind($stream);
Expand Down
10 changes: 10 additions & 0 deletions apps/dav/lib/CalDAV/Schedule/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ public function initialize(Server $server) {
$server->on('afterCreateFile', [$this, 'dispatchSchedulingResponses']);
}

/**
* Allow manual setting of the object change URL
* to support public write
*
* @param string $path
*/
public function setPathOfCalendarObjectChange(string $path): void {
$this->pathOfCalendarObjectChange = $path;
}

/**
* This method handler is invoked during fetching of properties.
*
Expand Down

0 comments on commit c9421e3

Please sign in to comment.