From e127ebeaa9fc19312a03676ab24a39ac9bc02def Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sun, 3 Mar 2024 13:07:22 +0100 Subject: [PATCH] Still testing CalDAV --- src/dav/calencoder.rs | 31 ++++++++++++++++++++++++++++++- src/dav/caltypes.rs | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/dav/calencoder.rs b/src/dav/calencoder.rs index f5f4924..9711f5f 100644 --- a/src/dav/calencoder.rs +++ b/src/dav/calencoder.rs @@ -389,7 +389,7 @@ impl QuickWritable for CalendarDataEmpty { impl QuickWritable for Comp { async fn write(&self, xml: &mut Writer, ctx: C) -> Result<(), QError> { - let mut start = ctx.create_cal_element("calendar-data"); + let mut start = ctx.create_cal_element("comp"); start.push_attribute(("name", self.name.as_str())); let end = start.to_end(); xml.write_event_async(Event::Start(start.clone())).await?; @@ -713,6 +713,35 @@ mod tests { CalExtension { root: true }, &CalendarQuery { selector: Some(CalendarSelector::Prop(dav::PropName(vec![ + dav::PropertyRequest::GetEtag, + dav::PropertyRequest::Extension(PropertyRequest::CalendarData(CalendarDataRequest { + mime: None, + comp: Some(Comp { + name: Component::VCalendar, + prop_kind: PropKind::Prop(vec![ + CalProp { + name: ComponentProperty("VERSION".into()), + novalue: None, + } + ]), + comp_kind: CompKind::Comp(vec![ + Comp { + name: Component::VEvent, + comp_kind: CompKind::Comp(vec![]), + prop_kind: PropKind::Prop(vec![ + CalProp { name: ComponentProperty("SUMMARY".into()), novalue: None }, + ]), + }, + Comp { + name: Component::VTimeZone, + prop_kind: PropKind::Prop(vec![]), + comp_kind: CompKind::Comp(vec![]), + } + ]), + }), + recurrence: None, + limit_freebusy_set: None, + })), ]))), filter: Filter(CompFilter { name: Component::VCalendar, diff --git a/src/dav/caltypes.rs b/src/dav/caltypes.rs index 9f4dfd6..d2e6169 100644 --- a/src/dav/caltypes.rs +++ b/src/dav/caltypes.rs @@ -1353,6 +1353,7 @@ pub enum Component { VEvent, VTodo, VAlarm, + VTimeZone, Unknown(String), } impl Component { @@ -1364,6 +1365,7 @@ impl Component { Self::VEvent => "VEVENT", Self::VTodo => "VTODO", Self::VAlarm => "VALARM", + Self::VTimeZone => "VTIMEZONE", Self::Unknown(c) => c, } }