Browse Source

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>
tags/v17.0.0beta1
Brad Rubenstein 5 years ago
parent
commit
6421e30b2c
1 changed files with 17 additions and 2 deletions
  1. 17
    2
      apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

+ 17
- 2
apps/dav/lib/CalDAV/Schedule/IMipPlugin.php View File

@@ -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
@@ -380,6 +380,21 @@ class IMipPlugin extends SabreIMipPlugin {
return $default;
}

/**
* @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
@@ -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);
}


Loading…
Cancel
Save