Skip to content

Commit

Permalink
Update attendence for external users
Browse files Browse the repository at this point in the history
For local users it's possible to select their calendar via the principal url and first update their own attendance status.
External users have no calendar event hence the recipient is the organizer.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Oct 8, 2021
1 parent 35be21d commit 817e7a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,10 @@ public function handleITipMessage(Message $iTipMessage) {
$schedulingPlugin = $this->server->getPlugin('caldav-schedule');
$schedulingPlugin->scheduleLocalDelivery($iTipMessage);
}

public function isExternalAttendee(string $principalUri): bool {
/** @var \Sabre\DAVACL\Plugin $aclPlugin */
$aclPlugin = $this->server->getPlugin('acl');
return $aclPlugin->getPrincipalByUri($principalUri) === null;
}
}
7 changes: 6 additions & 1 deletion apps/dav/lib/Controller/InvitationResponseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ private function buildITipResponse(array $row, string $partStat, int $guests = n
$iTipMessage->method = 'REPLY';
$iTipMessage->sequence = $row['sequence'];
$iTipMessage->sender = $row['attendee'];
$iTipMessage->recipient = $row['attendee'];

if ($this->responseServer->isExternalAttendee($row['attendee'])) {
$iTipMessage->recipient = $row['organizer'];
} else {
$iTipMessage->recipient = $row['attendee'];
}

$message = <<<EOF
BEGIN:VCALENDAR
Expand Down

0 comments on commit 817e7a9

Please sign in to comment.