Skip to content

Commit

Permalink
Merge pull request #28749 from nextcloud/backport/28692/stable21
Browse files Browse the repository at this point in the history
[stable21] Send attendence links to required and optinal attendees of an event without an RSVP
  • Loading branch information
kesselb authored Sep 8, 2021
2 parents 886a5b1 + ed2f133 commit ac08594
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ public function schedule(Message $iTipMessage) {
$this->addSubjectAndHeading($template, $l10n, $method, $summary);
$this->addBulletList($template, $l10n, $vevent);


// Only add response buttons to invitation requests: Fix Issue #11230
if (($method == self::METHOD_REQUEST) && $this->getAttendeeRSVP($attendee)) {
if (($method == self::METHOD_REQUEST) && $this->getAttendeeRsvpOrReqForParticipant($attendee)) {

/*
** Only offer invitation accept/reject buttons, which link back to the
Expand Down Expand Up @@ -390,12 +389,21 @@ private function getAttendeeLangOrDefault($default, Property $attendee = null) {
* @param Property|null $attendee
* @return bool
*/
private function getAttendeeRSVP(Property $attendee = null) {
private function getAttendeeRsvpOrReqForParticipant(Property $attendee = null) {
if ($attendee !== null) {
$rsvp = $attendee->offsetGet('RSVP');
if (($rsvp instanceof Parameter) && (strcasecmp($rsvp->getValue(), 'TRUE') === 0)) {
return true;
}
$role = $attendee->offsetGet('ROLE');
// @see https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.16
// Attendees without a role are assumed required and should receive an invitation link even if they have no RSVP set
if ($role === null
|| (($role instanceof Parameter) && (strcasecmp($role->getValue(), 'REQ-PARTICIPANT') === 0))
|| (($role instanceof Parameter) && (strcasecmp($role->getValue(), 'OPT-PARTICIPANT') === 0))
) {
return true;
}
}
// RFC 5545 3.2.17: default RSVP is false
return false;
Expand Down

0 comments on commit ac08594

Please sign in to comment.