Merge pull request #35973 from nextcloud/fix/hook-into-event-lifecycle

Hook into sabre event lifecycle for iMip Messages
This commit is contained in:
John Molakvoæ 2023-01-05 15:47:29 +01:00 committed by GitHub
commit c2b6922c33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View 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 {

View 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;