mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 14:02:29 +00:00
Add PROPPATCH operations for calendar resource
This commit is contained in:
@@ -228,16 +228,38 @@ impl Resource for CalendarFile {
|
|||||||
|
|
||||||
fn set_prop(&mut self, prop: Self::Prop) -> Result<(), rustical_dav::Error> {
|
fn set_prop(&mut self, prop: Self::Prop) -> Result<(), rustical_dav::Error> {
|
||||||
match prop {
|
match prop {
|
||||||
CalendarProp::CalendarColor(color) => {
|
CalendarProp::Resourcetype(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
self.calendar.color = color.0;
|
CalendarProp::CurrentUserPrincipal(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
}
|
CalendarProp::Owner(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
CalendarProp::Displayname(TextNode(name)) => {
|
CalendarProp::Displayname(TextNode(name)) => {
|
||||||
self.calendar.name = name;
|
self.calendar.name = name;
|
||||||
}
|
|
||||||
_ => return Err(rustical_dav::Error::PropReadOnly),
|
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
CalendarProp::CalendarColor(TextNode(color)) => {
|
||||||
|
self.calendar.color = color;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
CalendarProp::CalendarDescription(TextNode(description)) => {
|
||||||
|
self.calendar.description = description;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
CalendarProp::CalendarOrder(TextNode(order)) => {
|
||||||
|
self.calendar.order = match order {
|
||||||
|
Some(order) => order.parse().map_err(|_e| anyhow!("invalid order"))?,
|
||||||
|
None => 0,
|
||||||
|
};
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
CalendarProp::SupportedCalendarComponentSet(_) => {
|
||||||
|
Err(rustical_dav::Error::PropReadOnly)
|
||||||
|
}
|
||||||
|
CalendarProp::SupportedCalendarData(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
|
CalendarProp::Getcontenttype(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
|
CalendarProp::MaxResourceSize(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
|
CalendarProp::CurrentUserPrivilegeSet(_) => Err(rustical_dav::Error::PropReadOnly),
|
||||||
|
CalendarProp::Invalid => Err(rustical_dav::Error::PropReadOnly),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn get_path(&self) -> &str {
|
fn get_path(&self) -> &str {
|
||||||
&self.path
|
&self.path
|
||||||
|
|||||||
Reference in New Issue
Block a user