From 68d02a6df752f8f35328d539df2f3e0d4e2bb25c Mon Sep 17 00:00:00 2001 From: mdecimus Date: Mon, 8 Sep 2025 09:41:28 +0200 Subject: [PATCH] iTIP: Include event details in REPLY messages (fixes #2102) --- crates/groupware/src/scheduling/attendee.rs | 17 +++++++++++++++++ crates/groupware/src/scheduling/event_cancel.rs | 1 + crates/groupware/src/scheduling/itip.rs | 3 +-- .../resources/itip/rfc5546_event_recurring.txt | 3 +++ tests/resources/itip/rfc6638_recurring.txt | 3 +++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/crates/groupware/src/scheduling/attendee.rs b/crates/groupware/src/scheduling/attendee.rs index 704c7ca4..5339cad1 100644 --- a/crates/groupware/src/scheduling/attendee.rs +++ b/crates/groupware/src/scheduling/attendee.rs @@ -318,6 +318,23 @@ pub(crate) fn attendee_decline<'x>( cancel_comp.add_uid(itip.uid); cancel_comp.add_dtstamp(dt_stamp.clone()); cancel_comp.add_sequence(comp.sequence.unwrap_or_default()); + cancel_comp.entries.extend( + component + .entries + .iter() + .filter(|e| { + matches!( + e.name, + ICalendarProperty::Dtstart + | ICalendarProperty::Dtend + | ICalendarProperty::Duration + | ICalendarProperty::Due + | ICalendarProperty::Description + | ICalendarProperty::Summary + ) + }) + .cloned(), + ); if let InstanceId::Recurrence(recurrence_id) = instance_id { cancel_comp diff --git a/crates/groupware/src/scheduling/event_cancel.rs b/crates/groupware/src/scheduling/event_cancel.rs index 16fa91c3..875705b1 100644 --- a/crates/groupware/src/scheduling/event_cancel.rs +++ b/crates/groupware/src/scheduling/event_cancel.rs @@ -148,6 +148,7 @@ pub(crate) fn build_cancel_component( | ICalendarProperty::Summary | ICalendarProperty::Dtstart | ICalendarProperty::Dtend + | ICalendarProperty::Duration | ICalendarProperty::Due | ICalendarProperty::RecurrenceId | ICalendarProperty::Created diff --git a/crates/groupware/src/scheduling/itip.rs b/crates/groupware/src/scheduling/itip.rs index 36f58cfc..3263c34a 100644 --- a/crates/groupware/src/scheduling/itip.rs +++ b/crates/groupware/src/scheduling/itip.rs @@ -4,6 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ +use crate::scheduling::{ArchivedItipSummary, ItipMessage, ItipMessages}; use calcard::{ common::PartialDateTime, icalendar::{ @@ -18,8 +19,6 @@ use store::{ }; use trc::AddContext; -use crate::scheduling::{ArchivedItipSummary, ItipMessage, ItipMessages}; - pub(crate) fn itip_build_envelope(method: ICalendarMethod) -> ICalendarComponent { ICalendarComponent { component_type: ICalendarComponentType::VCalendar, diff --git a/tests/resources/itip/rfc5546_event_recurring.txt b/tests/resources/itip/rfc5546_event_recurring.txt index ac3e746f..663cdc23 100644 --- a/tests/resources/itip/rfc5546_event_recurring.txt +++ b/tests/resources/itip/rfc5546_event_recurring.txt @@ -856,6 +856,9 @@ METHOD:REPLY PRODID:-//Stalwart Labs LLC//Stalwart Server//EN VERSION:2.0 BEGIN:VEVENT +SUMMARY:Review Accounts +DTEND:19980303T220000Z +DTSTART:19980303T210000Z ATTENDEE;PARTSTAT=DECLINED:mailto:b@example.com ORGANIZER:mailto:a@example.com UID:123456789@example.com diff --git a/tests/resources/itip/rfc6638_recurring.txt b/tests/resources/itip/rfc6638_recurring.txt index 9e5408c0..c336f566 100644 --- a/tests/resources/itip/rfc6638_recurring.txt +++ b/tests/resources/itip/rfc6638_recurring.txt @@ -340,6 +340,9 @@ METHOD:REPLY PRODID:-//Stalwart Labs LLC//Stalwart Server//EN VERSION:2.0 BEGIN:VEVENT +SUMMARY:Review Internet-Draft +DTEND;TZID=America/Montreal:20090601T160000 +DTSTART;TZID=America/Montreal:20090601T150000 ATTENDEE;PARTSTAT=DECLINED:mailto:bernard@example.net ORGANIZER:mailto:cyrus@example.com RECURRENCE-ID;TZID=America/Montreal:20090603T150000