aboutsummaryrefslogtreecommitdiff
path: root/src/dav
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-03-03 13:07:22 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-03-03 13:07:22 +0100
commite127ebeaa9fc19312a03676ab24a39ac9bc02def (patch)
tree492f7679d799d3b55482b7ecb2970b010f3f92d3 /src/dav
parent4276090314207f36a7608976e7271682157ae41d (diff)
downloadaerogramme-e127ebeaa9fc19312a03676ab24a39ac9bc02def.tar.gz
aerogramme-e127ebeaa9fc19312a03676ab24a39ac9bc02def.zip
Still testing CalDAV
Diffstat (limited to 'src/dav')
-rw-r--r--src/dav/calencoder.rs31
-rw-r--r--src/dav/caltypes.rs2
2 files changed, 32 insertions, 1 deletions
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<C: CalContext> QuickWritable<C> for CalendarDataEmpty {
impl<C: CalContext> QuickWritable<C> for Comp {
async fn write(&self, xml: &mut Writer<impl AsyncWrite+Unpin>, 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,
}
}