Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 <[email protected]>
  • Loading branch information
Brad Rubenstein authored and georgehrke committed Aug 1, 2019
commit 2d756ace607b1a06e978a28b9b93a7258deceabd
19 changes: 17 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function schedule(Message $iTipMessage) {


// 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
Expand Down Expand Up @@ -380,6 +380,21 @@ private function getAttendeeLangOrDefault($default, Property $attendee = null) {
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
Expand Down Expand Up @@ -538,7 +553,7 @@ private function addResponseButtons(IEMailTemplate $template, IL10N $l10n,
$moreOptionsURL, $l10n->t('More options …')
]);
$text = $l10n->t('More options at %s', [$moreOptionsURL]);

$template->addBodyText($html, $text);
}

Expand Down