summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-10-22 12:07:39 +0200
committerGitHub <noreply@github.com>2021-10-22 12:07:39 +0200
commit8b742ab39401ac4e4a40aa3aab01742ea09b8344 (patch)
tree73940c5ccff06cec84291867bef495fa2052d811 /apps/dav/lib
parent2be0eda47cb3891573f4e0c609a46a080095b017 (diff)
parentfab887cb7c577a3e70219e686707bb52e0bc9bbe (diff)
downloadnextcloud-server-8b742ab39401ac4e4a40aa3aab01742ea09b8344.tar.gz
nextcloud-server-8b742ab39401ac4e4a40aa3aab01742ea09b8344.zip
Merge pull request #28997 from nextcloud/fix/set-attendee-as-recipient
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php6
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php7
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 90e2e478e1c..af3d7c1269a 100644
--- a/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php
+++ b/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php
@@ -124,4 +124,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 f6923152dce..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['organizer'];
+
+ if ($this->responseServer->isExternalAttendee($row['attendee'])) {
+ $iTipMessage->recipient = $row['organizer'];
+ } else {
+ $iTipMessage->recipient = $row['attendee'];
+ }
$message = <<<EOF
BEGIN:VCALENDAR