Skip to content

Commit 02b7fe2

Browse files
committed
Send Invitation to Attendees with ROLE=REQ-PARTICIPANT
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent a65d384 commit 02b7fe2

File tree

2 files changed

+51
-3
lines changed

2 files changed

+51
-3
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace OCA\DAV\CalDAV\Appointments;
6+
7+
/**
8+
* Default built-in types provided by Doctrine DBAL.
9+
*/
10+
class Ruleset
11+
{
12+
public const MONTH = 'MONTH';
13+
public const WEEK = 'WEEK';
14+
public const DAY = 'DAY';
15+
public const MON = 'MON';
16+
public const TUE = 'TUE';
17+
public const WED = 'WED';
18+
public const THU = 'THU';
19+
public const FRI = 'FRI';
20+
public const SAT = 'SAT';
21+
public const SUN = 'SUN';
22+
public const EVERY_X = '%s %s %s';
23+
24+
/**
25+
* @codeCoverageIgnore
26+
*/
27+
private function __construct()
28+
{
29+
}
30+
31+
public static function makeDatabaseRuleset(string $dateFrom, array $days, string $dateTo){
32+
// either month - ruleset starts with "MONTH"
33+
$ruleset = self::MONTH;
34+
// or week - ruleset starts with "WEEK"
35+
36+
$ruleset = self::WEEK;
37+
foreach( $days as $day) {
38+
}
39+
40+
// or single slot for only one day with no repetition - ruleset starts with "day"
41+
42+
}
43+
}

apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ public function schedule(Message $iTipMessage) {
255255
$this->addSubjectAndHeading($template, $l10n, $method, $summary);
256256
$this->addBulletList($template, $l10n, $vevent);
257257

258-
259258
// Only add response buttons to invitation requests: Fix Issue #11230
260-
if (($method == self::METHOD_REQUEST) && $this->getAttendeeRSVP($attendee)) {
259+
if (($method == self::METHOD_REQUEST) && $this->getAttendeeRsvpOrReqParticipant($attendee)) {
261260

262261
/*
263262
** Only offer invitation accept/reject buttons, which link back to the
@@ -395,12 +394,18 @@ private function getAttendeeLangOrDefault($default, Property $attendee = null) {
395394
* @param Property|null $attendee
396395
* @return bool
397396
*/
398-
private function getAttendeeRSVP(Property $attendee = null) {
397+
private function getAttendeeRsvpOrReqParticipant(Property $attendee = null) {
399398
if ($attendee !== null) {
400399
$rsvp = $attendee->offsetGet('RSVP');
401400
if (($rsvp instanceof Parameter) && (strcasecmp($rsvp->getValue(), 'TRUE') === 0)) {
402401
return true;
403402
}
403+
$role = $attendee->offsetGet('ROLE');
404+
// @see https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.16
405+
// Attendees without a role are assumed required and should receive an invitation link even if they have no RSVP set
406+
if($role === null || (($rsvp instanceof Parameter) && (strcasecmp($role->getValue(), 'REQ-PARTICIPANT') === 0))) {
407+
return true;
408+
}
404409
}
405410
// RFC 5545 3.2.17: default RSVP is false
406411
return false;

0 commit comments

Comments
 (0)