1+ From 49d53f187089ec9a67917e564a87c6dea89ea839 Mon Sep 17 00:00:00 2001
2+ From: SebastianKrupinski <
[email protected] >
3+ Date: Tue, 30 Dec 2025 13:48:29 -0500
4+ Subject: [PATCH] fix: send participation reply on fresh event
5+
6+ Signed-off-by: SebastianKrupinski <
[email protected] >
7+ ---
8+ lib/ITip/Broker.php | 25 ++++++---
9+ .../VObject/ITip/BrokerAttendeeReplyTest.php | 52 +++++++++++++++++++
10+ 2 files changed, 71 insertions(+), 6 deletions(-)
11+
12+ diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
13+ index 76ee0c71..e621c6e2 100644
14+ --- a/lib/ITip/Broker.php
15+ +++ b/lib/ITip/Broker.php
16+ @@ -246,16 +246,29 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null): array
17+ $baseCalendar = $oldCalendar;
18+ }
19+
20+ + // Check if the user is the organizer
21+ if (in_array($eventInfo['organizer'], $userHref)) {
22+ return $this->parseEventForOrganizer($baseCalendar, $eventInfo, $oldEventInfo);
23+ - } elseif ($oldCalendar) {
24+ - // We need to figure out if the user is an attendee, but we're only
25+ - // doing so if there's an oldCalendar, because we only want to
26+ - // process updates, not creation of new events.
27+ - foreach ($eventInfo['attendees'] as $attendee) {
28+ - if (in_array($attendee['href'], $userHref)) {
29+ + }
30+ +
31+ + // Check if the user is an attendee
32+ + foreach ($eventInfo['attendees'] as $attendee) {
33+ + if (in_array($attendee['href'], $userHref)) {
34+ + // If this is a event update, we always generate a reply
35+ + if ($oldCalendar) {
36+ return $this->parseEventForAttendee($baseCalendar, $eventInfo, $oldEventInfo, $attendee['href']);
37+ }
38+ +
39+ + // If this is a new event, we only generate a reply if the participation status is set
40+ + foreach ($attendee['instances'] as $instance) {
41+ + if (isset($instance['partstat']) && 'NEEDS-ACTION' !== $instance['partstat']) {
42+ + // Attendee has responded (ACCEPTED/DECLINED/TENTATIVE) - generate REPLY
43+ + return $this->parseEventForAttendee($baseCalendar, $eventInfo, $oldEventInfo, $attendee['href']);
44+ + }
45+ + }
46+ +
47+ + // User is attendee but no response to process
48+ + break;
49+ }
50+ }
51+
0 commit comments