mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 04:38:19 +00:00
Add truncation for automatically derived timezones
This commit is contained in:
@@ -4,8 +4,8 @@ use axum::{
|
||||
extract::{Path, State},
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use caldata::IcalParser;
|
||||
use caldata::component::{Component, ComponentMut};
|
||||
use caldata::{IcalParser, parser::ParserOptions};
|
||||
use http::StatusCode;
|
||||
use rustical_dav::header::Overwrite;
|
||||
use rustical_ical::CalendarObjectType;
|
||||
@@ -50,7 +50,7 @@ pub async fn route_import<C: CalendarStore, S: SubscriptionStore>(
|
||||
cal.remove_property("X-WR-CALDESC");
|
||||
cal.remove_property("X-WR-CALCOLOR");
|
||||
cal.remove_property("X-WR-TIMEZONE");
|
||||
let cal = cal.build(None).unwrap();
|
||||
let cal = cal.build(&ParserOptions::default(), None).unwrap();
|
||||
|
||||
// Make sure timezone is valid
|
||||
if let Some(timezone_id) = timezone_id.as_ref() {
|
||||
|
||||
@@ -7,7 +7,7 @@ use axum::{
|
||||
use caldata::{
|
||||
VcardParser,
|
||||
component::{Component, ComponentMut},
|
||||
parser::ContentLine,
|
||||
parser::{ContentLine, ParserOptions},
|
||||
};
|
||||
use http::StatusCode;
|
||||
use rustical_store::{Addressbook, AddressbookStore, SubscriptionStore, auth::Principal};
|
||||
@@ -37,7 +37,7 @@ pub async fn route_import<AS: AddressbookStore, S: SubscriptionStore>(
|
||||
value: Some(uuid::Uuid::new_v4().to_string()),
|
||||
params: vec![].into(),
|
||||
});
|
||||
card = card_mut.build(None).unwrap();
|
||||
card = card_mut.build(&ParserOptions::default(), None).unwrap();
|
||||
}
|
||||
// TODO: Make nicer
|
||||
let uid = card.get_uid().unwrap();
|
||||
|
||||
@@ -6,7 +6,7 @@ use caldata::{
|
||||
IcalEventBuilder, VcardContact,
|
||||
},
|
||||
generator::Emitter,
|
||||
parser::ContentLine,
|
||||
parser::{ContentLine, ParserOptions},
|
||||
property::{
|
||||
Calscale, IcalCALSCALEProperty, IcalDTENDProperty, IcalDTSTAMPProperty,
|
||||
IcalDTSTARTProperty, IcalPRODIDProperty, IcalRRULEProperty, IcalSUMMARYProperty,
|
||||
@@ -136,7 +136,7 @@ impl AddressObject {
|
||||
inner: Some(CalendarInnerDataBuilder::Event(vec![event])),
|
||||
vtimezones: BTreeMap::default(),
|
||||
}
|
||||
.build(None)?
|
||||
.build(&ParserOptions::default(), None)?
|
||||
.into(),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user