Skip to content

Commit 6067441

Browse files
fix: add send participation reply on fresh event patch
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent 08d9ba0 commit 6067441

File tree

4 files changed

+75
-7
lines changed

4 files changed

+75
-7
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 49d53f187089ec9a67917e564a87c6dea89ea839 Mon Sep 17 00:00:00 2001
2+
From: SebastianKrupinski <krupinskis05@gmail.com>
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 <krupinskis05@gmail.com>
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+

composer.patches.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"Check for instanceof INode instead of Node": ".patches/check-for-instanceof-INode-instead-of-Node-1595.patch"
99
},
1010
"sabre/vobject": {
11-
"fix use RDATE in time range check and use all instances": ".patches/sabre-vobject-rdate.patch"
11+
"fix use RDATE in time range check and use all instances": ".patches/sabre-vobject-rdate.patch",
12+
"fix send participation reply on fresh event": ".patches/sabre-vobject-iTipBroker-replies.patch"
1213
}
1314
}
1415
}

sabre/vobject/PATCHES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ Patches applied to this directory:
44
fix use RDATE in time range check and use all instances
55
Source: .patches/sabre-vobject-rdate.patch
66

7+
fix send participation reply on fresh event
8+
Source: .patches/sabre-vobject-iTipBroker-replies.patch
9+
710

sabre/vobject/lib/ITip/Broker.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,29 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null)
240240
$baseCalendar = $oldCalendar;
241241
}
242242

243+
// Check if the user is the organizer
243244
if (in_array($eventInfo['organizer'], $userHref)) {
244245
return $this->parseEventForOrganizer($baseCalendar, $eventInfo, $oldEventInfo);
245-
} elseif ($oldCalendar) {
246-
// We need to figure out if the user is an attendee, but we're only
247-
// doing so if there's an oldCalendar, because we only want to
248-
// process updates, not creation of new events.
249-
foreach ($eventInfo['attendees'] as $attendee) {
250-
if (in_array($attendee['href'], $userHref)) {
246+
}
247+
248+
// Check if the user is an attendee
249+
foreach ($eventInfo['attendees'] as $attendee) {
250+
if (in_array($attendee['href'], $userHref)) {
251+
// If this is a event update, we always generate a reply
252+
if ($oldCalendar) {
251253
return $this->parseEventForAttendee($baseCalendar, $eventInfo, $oldEventInfo, $attendee['href']);
252254
}
255+
256+
// If this is a new event, we only generate a reply if the participation status is set
257+
foreach ($attendee['instances'] as $instance) {
258+
if (isset($instance['partstat']) && 'NEEDS-ACTION' !== $instance['partstat']) {
259+
// Attendee has responded (ACCEPTED/DECLINED/TENTATIVE) - generate REPLY
260+
return $this->parseEventForAttendee($baseCalendar, $eventInfo, $oldEventInfo, $attendee['href']);
261+
}
262+
}
263+
264+
// User is attendee but no response to process
265+
break;
253266
}
254267
}
255268

0 commit comments

Comments
 (0)