Still testing CalDAV
This commit is contained in:
parent
4276090314
commit
e127ebeaa9
2 changed files with 32 additions and 1 deletions
|
@ -389,7 +389,7 @@ impl<C: CalContext> QuickWritable<C> for CalendarDataEmpty {
|
||||||
|
|
||||||
impl<C: CalContext> QuickWritable<C> for Comp {
|
impl<C: CalContext> QuickWritable<C> for Comp {
|
||||||
async fn write(&self, xml: &mut Writer<impl AsyncWrite+Unpin>, ctx: C) -> Result<(), QError> {
|
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()));
|
start.push_attribute(("name", self.name.as_str()));
|
||||||
let end = start.to_end();
|
let end = start.to_end();
|
||||||
xml.write_event_async(Event::Start(start.clone())).await?;
|
xml.write_event_async(Event::Start(start.clone())).await?;
|
||||||
|
@ -713,6 +713,35 @@ mod tests {
|
||||||
CalExtension { root: true },
|
CalExtension { root: true },
|
||||||
&CalendarQuery {
|
&CalendarQuery {
|
||||||
selector: Some(CalendarSelector::Prop(dav::PropName(vec![
|
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 {
|
filter: Filter(CompFilter {
|
||||||
name: Component::VCalendar,
|
name: Component::VCalendar,
|
||||||
|
|
|
@ -1353,6 +1353,7 @@ pub enum Component {
|
||||||
VEvent,
|
VEvent,
|
||||||
VTodo,
|
VTodo,
|
||||||
VAlarm,
|
VAlarm,
|
||||||
|
VTimeZone,
|
||||||
Unknown(String),
|
Unknown(String),
|
||||||
}
|
}
|
||||||
impl Component {
|
impl Component {
|
||||||
|
@ -1364,6 +1365,7 @@ impl Component {
|
||||||
Self::VEvent => "VEVENT",
|
Self::VEvent => "VEVENT",
|
||||||
Self::VTodo => "VTODO",
|
Self::VTodo => "VTODO",
|
||||||
Self::VAlarm => "VALARM",
|
Self::VAlarm => "VALARM",
|
||||||
|
Self::VTimeZone => "VTIMEZONE",
|
||||||
Self::Unknown(c) => c,
|
Self::Unknown(c) => c,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue