diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-10-28 11:19:13 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-11-09 16:37:34 +0100 |
commit | 908b7aa70af4417a0011e1b09ba44dc9b50792f2 (patch) | |
tree | 54e09dbbaa05d8355c5642aa54ba2644e15baddd /apps/dav/lib/CalDAV/CalendarImpl.php | |
parent | 2a684f674164640d917a4fd1b3631b6ed3b36eb3 (diff) | |
download | nextcloud-server-908b7aa70af4417a0011e1b09ba44dc9b50792f2.tar.gz nextcloud-server-908b7aa70af4417a0011e1b09ba44dc9b50792f2.zip |
Attempt to fix CalendarImpl tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dav/lib/CalDAV/CalendarImpl.php')
-rw-r--r-- | apps/dav/lib/CalDAV/CalendarImpl.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index 79a5626f322..f9e9c584808 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -147,7 +147,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { $server = new InvitationResponseServer(false); /** @var CustomPrincipalPlugin $plugin */ - $plugin = $server->server->getPlugin('auth'); + $plugin = $server->getServer()->getPlugin('auth'); // we're working around the previous implementation // that only allowed the public system principal to be used // so set the custom principal here @@ -163,14 +163,14 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { // Force calendar change URI /** @var Schedule\Plugin $schedulingPlugin */ - $schedulingPlugin = $server->server->getPlugin('caldav-schedule'); + $schedulingPlugin = $server->getServer()->getPlugin('caldav-schedule'); $schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename); $stream = fopen('php://memory', 'rb+'); fwrite($stream, $calendarData); rewind($stream); try { - $server->server->createFile($fullCalendarFilename, $stream); + $server->getServer()->createFile($fullCalendarFilename, $stream); } catch (Conflict $e) { throw new CalendarException('Could not create new calendar event: ' . $e->getMessage(), 0, $e); } finally { @@ -182,10 +182,10 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { * @throws CalendarException */ public function handleIMipMessage(string $name, string $calendarData): void { - $server = new InvitationResponseServer(false); + $server = $this->getInvitationResponseServer(); /** @var CustomPrincipalPlugin $plugin */ - $plugin = $server->server->getPlugin('auth'); + $plugin = $server->getServer()->getPlugin('auth'); // we're working around the previous implementation // that only allowed the public system principal to be used // so set the custom principal here @@ -196,7 +196,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { } // Force calendar change URI /** @var Schedule\Plugin $schedulingPlugin */ - $schedulingPlugin = $server->server->getPlugin('caldav-schedule'); + $schedulingPlugin = $server->getServer()->getPlugin('caldav-schedule'); // Let sabre handle the rest $iTipMessage = new Message(); /** @var VCalendar $vObject */ @@ -232,4 +232,8 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage { $iTipMessage->message = $vObject; $schedulingPlugin->scheduleLocalDelivery($iTipMessage); } + + public function getInvitationResponseServer() { + return new InvitationResponseServer(false); + } } |