]> source.dussan.org Git - nextcloud-server.git/commitdiff
Hook into sabre event lifecycle for iMip Messages 35973/head
authorAnna Larch <anna@nextcloud.com>
Tue, 3 Jan 2023 23:21:36 +0000 (00:21 +0100)
committerAnna Larch <anna@nextcloud.com>
Thu, 5 Jan 2023 10:55:26 +0000 (11:55 +0100)
Signed-off-by: Anna Larch <anna@nextcloud.com>
apps/dav/lib/CalDAV/CalendarImpl.php
apps/dav/tests/unit/CalDAV/CalendarImplTest.php

index 3fb28a631a724efc65e692dcc8ca354bdf2b9677..cc57aa36469328134d0c7d1efb7408d3fc43ad02 100644 (file)
@@ -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 {
index cc0b963634c14ecf42af29ece86b299221b2dc79..5adb7041e8b5f9f8a2b6d15d812a2e09ffe09b55 100644 (file)
@@ -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;