aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-01-04 00:21:36 +0100
committerAnna Larch <anna@nextcloud.com>2023-01-05 11:55:26 +0100
commitd58ecdcfad378132e9b1dcf47b098c45ccbc371d (patch)
tree9139488ad83dd04781241b1df102a08792a7f280
parent0e6a8d72f8e5f71a6dcc0c9ecee6268405b8797f (diff)
downloadnextcloud-server-d58ecdcfad378132e9b1dcf47b098c45ccbc371d.tar.gz
nextcloud-server-d58ecdcfad378132e9b1dcf47b098c45ccbc371d.zip
Hook into sabre event lifecycle for iMip Messages
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r--apps/dav/lib/CalDAV/CalendarImpl.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarImplTest.php7
2 files changed, 5 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php
index 3fb28a631a7..cc57aa36469 100644
--- a/apps/dav/lib/CalDAV/CalendarImpl.php
+++ b/apps/dav/lib/CalDAV/CalendarImpl.php
@@ -229,7 +229,7 @@ class CalendarImpl implements ICreateFromString, IHandleImipMessage {
$iTipMessage->component = 'VEVENT';
$iTipMessage->sequence = isset($vEvent->{'SEQUENCE'}) ? (int)$vEvent->{'SEQUENCE'}->getValue() : 0;
$iTipMessage->message = $vObject;
- $schedulingPlugin->scheduleLocalDelivery($iTipMessage);
+ $server->server->emit('schedule', [$iTipMessage]);
}
public function getInvitationResponseServer(): InvitationResponseServer {
diff --git a/apps/dav/tests/unit/CalDAV/CalendarImplTest.php b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
index cc0b963634c..5adb7041e8b 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarImplTest.php
@@ -168,9 +168,6 @@ EOF;
$schedulingPlugin = $this->createMock(Plugin::class);
$iTipMessage = $this->getITipMessage($message);
$iTipMessage->recipient = "mailto:lewis@stardew-tent-living.com";
- $schedulingPlugin->expects(self::once())
- ->method('scheduleLocalDelivery')
- ->with($iTipMessage);
$server = $this->createMock(Server::class);
$server->expects($this->any())
@@ -180,6 +177,8 @@ EOF;
['acl', $aclPlugin],
['caldav-schedule', $schedulingPlugin]
]);
+ $server->expects(self::once())
+ ->method('emit');
$invitationResponseServer = $this->createPartialMock(InvitationResponseServer::class, ['getServer', 'isExternalAttendee']);
$invitationResponseServer->server = $server;
@@ -224,6 +223,8 @@ EOF;
['acl', $aclPlugin],
['caldav-schedule', $schedulingPlugin]
]);
+ $server->expects(self::never())
+ ->method('emit');
$invitationResponseServer = $this->createPartialMock(InvitationResponseServer::class, ['getServer']);
$invitationResponseServer->server = $server;