diff --git a/lib/Service/Proposal/ProposalService.php b/lib/Service/Proposal/ProposalService.php index 06bbf8e569..f4b49beb48 100644 --- a/lib/Service/Proposal/ProposalService.php +++ b/lib/Service/Proposal/ProposalService.php @@ -375,6 +375,7 @@ public function convertProposal(IUser $user, int $proposalId, int $dateId, array $vObject->serialize() ); } + $this->applyCalendarBlockersParticipant($user, $proposal, 'M', $vObject); // destroy the proposal entry $this->proposalVoteMapper->deleteByProposalId($user->getUID(), $proposal->getId()); @@ -633,7 +634,7 @@ private function syncCalendarBlockers(IUser $user, ProposalObject $proposal, str $vObject = $this->constructCalendarBlocker($user, $proposal); $this->applyCalendarBlockersOrganizer($user, $userCalendarUri, $userEventUri, $vObject); - $this->applyCalendarBlockersParticipant($user, $proposal, $reason, $userCalendarUri, $userEventUri, $vObject); + $this->applyCalendarBlockersParticipant($user, $proposal, $reason, $vObject); } @@ -720,7 +721,7 @@ private function deleteCalendarBlockersOrganizer(IUser $user, string $calendarUr /** * Create or update calendar blocker event(s) for participant(s) */ - private function applyCalendarBlockersParticipant(IUser $user, ProposalObject $proposal, string $reason, string $calendarUri, ?string $eventUri, VCalendar $vObject): void { + private function applyCalendarBlockersParticipant(IUser $user, ProposalObject $proposal, string $reason, VCalendar $vObject): void { // if the calendar manager does not have a handleIMip method, we cannot generate iTip messages if (!method_exists($this->calendarManager, 'handleIMip')) { return; diff --git a/tests/php/unit/Service/Proposal/ProposalServiceTest.php b/tests/php/unit/Service/Proposal/ProposalServiceTest.php index e36add0754..c62d245a8b 100644 --- a/tests/php/unit/Service/Proposal/ProposalServiceTest.php +++ b/tests/php/unit/Service/Proposal/ProposalServiceTest.php @@ -580,6 +580,16 @@ public function testConvertProposalSuccess(): void { ->method('deleteById') ->with('testuser', 1); + // the internal participant must be looked up and notified of the finalised event via iTIP + $participantUser = $this->createMock(IUser::class); + $participantUser->method('getUID')->willReturn('alice'); + $this->userManager->expects($this->once()) + ->method('getByEmail') + ->with('alice@example.com') + ->willReturn([$participantUser]); + $this->calendarManager->expects($this->once()) + ->method('handleIMip'); + // test and assertions $this->service->convertProposal($this->user, 1, 10, ['attendancePreset' => true]); $this->addToAssertionCount(1); // If we reached this point, the test is successfully completed