Update caldata-rs

This commit is contained in:
Lennart K
2026-01-31 14:17:10 +01:00
parent cc333f7182
commit 41eed732eb
9 changed files with 21 additions and 40 deletions

View File

@@ -43,28 +43,28 @@ pub async fn route_get<C: CalendarStore, S: SubscriptionStore>(
if let Some(displayname) = calendar.meta.displayname {
props.push(ContentLine {
name: "X-WR-CALNAME".to_owned(),
value: Some(displayname),
value: displayname,
params: vec![].into(),
});
}
if let Some(description) = calendar.meta.description {
props.push(ContentLine {
name: "X-WR-CALDESC".to_owned(),
value: Some(description),
value: description,
params: vec![].into(),
});
}
if let Some(color) = calendar.meta.color {
props.push(ContentLine {
name: "X-WR-CALCOLOR".to_owned(),
value: Some(color),
value: color,
params: vec![].into(),
});
}
if let Some(timezone_id) = calendar.timezone_id {
props.push(ContentLine {
name: "X-WR-TIMEZONE".to_owned(),
value: Some(timezone_id),
value: timezone_id,
params: vec![].into(),
});
}

View File

@@ -35,16 +35,16 @@ pub async fn route_import<C: CalendarStore, S: SubscriptionStore>(
// Extract calendar metadata
let displayname = cal
.get_property("X-WR-CALNAME")
.and_then(|prop| prop.value.clone());
.map(|prop| prop.value.clone());
let description = cal
.get_property("X-WR-CALDESC")
.and_then(|prop| prop.value.clone());
.map(|prop| prop.value.clone());
let color = cal
.get_property("X-WR-CALCOLOR")
.and_then(|prop| prop.value.clone());
.map(|prop| prop.value.clone());
let timezone_id = cal
.get_property("X-WR-TIMEZONE")
.and_then(|prop| prop.value.clone());
.map(|prop| prop.value.clone());
// These properties should not appear in the expanded calendar objects
cal.remove_property("X-WR-CALNAME");
cal.remove_property("X-WR-CALDESC");