Skip to content

caldav party crasher#59988

Open
kesselb wants to merge 1 commit intomasterfrom
feat/party-crasher
Open

caldav party crasher#59988
kesselb wants to merge 1 commit intomasterfrom
feat/party-crasher

Conversation

@kesselb
Copy link
Copy Markdown
Contributor

@kesselb kesselb commented Apr 28, 2026

Summary

Calendar: nextcloud/calendar#8222

TODO

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kesselb kesselb added this to the Nextcloud 34 milestone Apr 28, 2026
@kesselb kesselb self-assigned this Apr 28, 2026
@kesselb kesselb added enhancement 2. developing Work in progress feature: caldav Related to CalDAV internals labels Apr 28, 2026
@kesselb kesselb requested review from Altahrim, artonge, icewind1991 and salmart-dev and removed request for a team April 28, 2026 21:29
foreach ($newObject->ATTENDEE as $attendee) {
if ($attendee->getValue() === $itipMessage->sender) {
$attendeeFound = true;
$attendee['PARTSTAT'] = $partstat;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is matching the upstream: https://github.com/sabre-io/vobject/blob/2104a3ea37e248262617a8acbfe7648d8e2fd8bd/lib/ITip/Broker.php#L437

@SebastianKrupinski do you know why we don't unset RSVP here like for the existing events in the loop before?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, Just saw this comment. According to the RFC

Parameter Name
RSVP
Purpose
To specify whether there is an expectation of a favor of a reply from the calendar user specified by the property value.

So I would say once we have a reply there is no need for the RSVP

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Nextcloud-specific “party crasher” control for CalDAV iTIP REPLY handling, plus unit tests, to prevent/allow adding new attendees from replies based on an X-NC-PARTY-CRASHER flag.

Changes:

  • Add custom processMessageReply() handling in TipBroker to optionally reject “party crasher” attendees and to generate missing recurring exceptions.
  • Register X-NC-PARTY-CRASHER as a typed VObject property via VCalendar::$propertyMap.
  • Add unit tests covering allow/disallow/default behavior for single and generated recurring instances.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
apps/dav/lib/CalDAV/TipBroker.php Implements REPLY processing with party-crasher gating and recurring-instance generation.
apps/dav/lib/AppInfo/Application.php Registers X-NC-PARTY-CRASHER in Sabre VObject’s VCalendar property map at app boot.
apps/dav/tests/unit/CalDAV/TipBrokerTest.php Adds coverage for party-crasher allow/deny/default scenarios (including generated recurrences).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/dav/lib/CalDAV/TipBroker.php Outdated
Comment thread apps/dav/lib/CalDAV/TipBroker.php
Comment thread apps/dav/lib/CalDAV/TipBroker.php
Comment thread apps/dav/lib/CalDAV/TipBroker.php
foreach ($properties as $property) {
if ($property instanceof Boolean) {
return $property->getValue() === 'TRUE';
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partyCrasher() only checks properties that are instances of Sabre\VObject\Property\Boolean. If the event contains X-NC-PARTY-CRASHER:FALSE but it gets parsed as a generic/unknown property (e.g. if the property map wasn’t initialized before parsing), this method will fall back to true and still allow party crashers. To make this robust, consider also checking the property's string value (case-insensitive) whenever the property exists, not only when it’s a Boolean instance.

Suggested change
}
}
$value = strtoupper(trim((string)$property->getValue()));
if ($value === 'TRUE' || $value === '1' || $value === 'YES') {
return true;
}
if ($value === 'FALSE' || $value === '0' || $value === 'NO') {
return false;
}

Copilot uses AI. Check for mistakes.
Comment thread apps/dav/tests/unit/CalDAV/TipBrokerTest.php Outdated
Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick review

In terms of naming we could go with invitation forwarding. That's what we will call it on the UI, and what other platforms (Outlook) call it.

Comment thread apps/dav/lib/CalDAV/TipBroker.php Outdated
Comment thread apps/dav/lib/CalDAV/TipBroker.php Outdated
@kesselb kesselb force-pushed the feat/party-crasher branch 2 times, most recently from b31b5c5 to 4506059 Compare April 30, 2026 19:22
AI-assisted: OpenCode (gpt-5.4)

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb force-pushed the feat/party-crasher branch from 4506059 to 805866a Compare May 7, 2026 19:57
@kesselb kesselb requested a review from DerDreschner May 7, 2026 20:06
@kesselb kesselb added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement feature: caldav Related to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants