diff options
author | Brad Rubenstein <brad@wbr.tech> | 2018-11-12 12:11:47 -0800 |
---|---|---|
committer | Brad Rubenstein <brad@wbr.tech> | 2019-02-28 01:42:47 +0000 |
commit | 6421e30b2ccad91bb708d51609d7dd72cbfc0ebe (patch) | |
tree | b28cabf7714866e0ed6ba6602de29018a48cdbe1 | |
parent | 15400dd18f5346cdad749aef3c4617088b52c922 (diff) | |
download | nextcloud-server-6421e30b2ccad91bb708d51609d7dd72cbfc0ebe.tar.gz nextcloud-server-6421e30b2ccad91bb708d51609d7dd72cbfc0ebe.zip |
Respect RSVP parameter for attendees when adding accept/decline buttons.
If RSVP=TRUE parameter is FALSE or absent for an ATTENDEE, then do no
present accept/decline buttons. The organizer isn't asking for an RSVP.
Signed-off-by: Brad Rubenstein <brad@wbr.tech>
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 4375c081d55..987e6c86f5d 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -242,7 +242,7 @@ class IMipPlugin extends SabreIMipPlugin { // Only add response buttons to invitation requests: Fix Issue #11230 - if ($method == self::METHOD_REQUEST) { + if (($method == self::METHOD_REQUEST) && $this->getAttendeeRSVP($attendee)) { /* ** Only offer invitation accept/reject buttons, which link back to the @@ -381,6 +381,21 @@ class IMipPlugin extends SabreIMipPlugin { } /** + * @param Property|null $attendee + * @return bool + */ + private function getAttendeeRSVP(Property $attendee = null) { + if ($attendee !== null) { + $rsvp = $attendee->offsetGet('RSVP'); + if (($rsvp instanceof Parameter) && (strcasecmp($rsvp->getValue(), 'TRUE') === 0)) { + return true; + } + } + // RFC 5545 3.2.17: default RSVP is false + return false; + } + + /** * @param IL10N $l10n * @param Property $dtstart * @param Property $dtend @@ -538,7 +553,7 @@ class IMipPlugin extends SabreIMipPlugin { $moreOptionsURL, $l10n->t('More options …') ]); $text = $l10n->t('More options at %s', [$moreOptionsURL]); - + $template->addBodyText($html, $text); } |