diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2021-10-08 16:34:43 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2021-10-08 18:12:37 +0200 |
commit | fab887cb7c577a3e70219e686707bb52e0bc9bbe (patch) | |
tree | 05207504dc8e3ac1738265ba9170d6d8d0d875bd /apps/dav/lib | |
parent | 35be21dbb7d3f32405c9813694ad61c2393114d8 (diff) | |
download | nextcloud-server-fab887cb7c577a3e70219e686707bb52e0bc9bbe.tar.gz nextcloud-server-fab887cb7c577a3e70219e686707bb52e0bc9bbe.zip |
Update attendence for external users
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>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Controller/InvitationResponseController.php | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php index d1ea6902af3..7910eb614b7 100644 --- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php +++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php @@ -121,4 +121,10 @@ class InvitationResponseServer { $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; + } } diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php index 9dbe43199d8..de22e3ba6a9 100644 --- a/apps/dav/lib/Controller/InvitationResponseController.php +++ b/apps/dav/lib/Controller/InvitationResponseController.php @@ -198,7 +198,12 @@ class InvitationResponseController extends Controller { $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 |