mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
Add <remove> to PROPPATCH implementation and some refactoring
This commit is contained in:
@@ -272,6 +272,41 @@ impl Resource for CalendarFile {
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_prop(&mut self, prop: Self::PropName) -> Result<(), rustical_dav::Error> {
|
||||
match prop {
|
||||
CalendarPropName::Resourcetype => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::CurrentUserPrincipal => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::Owner => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::Displayname => {
|
||||
self.calendar.displayname = None;
|
||||
Ok(())
|
||||
}
|
||||
CalendarPropName::CalendarColor => {
|
||||
self.calendar.color = None;
|
||||
Ok(())
|
||||
}
|
||||
CalendarPropName::CalendarDescription => {
|
||||
self.calendar.description = None;
|
||||
Ok(())
|
||||
}
|
||||
CalendarPropName::CalendarTimezone => {
|
||||
self.calendar.timezone = None;
|
||||
Ok(())
|
||||
}
|
||||
CalendarPropName::CalendarOrder => {
|
||||
self.calendar.order = 0;
|
||||
Ok(())
|
||||
}
|
||||
CalendarPropName::SupportedCalendarComponentSet => {
|
||||
Err(rustical_dav::Error::PropReadOnly)
|
||||
}
|
||||
CalendarPropName::SupportedCalendarData => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::Getcontenttype => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::MaxResourceSize => Err(rustical_dav::Error::PropReadOnly),
|
||||
CalendarPropName::CurrentUserPrivilegeSet => Err(rustical_dav::Error::PropReadOnly),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_path(&self) -> &str {
|
||||
&self.path
|
||||
}
|
||||
|
||||
@@ -70,10 +70,6 @@ impl Resource for EventFile {
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
fn set_prop(&mut self, _prop: Self::Prop) -> Result<(), rustical_dav::Error> {
|
||||
Err(rustical_dav::Error::PropReadOnly)
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
|
||||
@@ -91,10 +91,6 @@ impl Resource for PrincipalFile {
|
||||
}
|
||||
}
|
||||
|
||||
fn set_prop(&mut self, _prop: Self::Prop) -> Result<(), rustical_dav::Error> {
|
||||
Err(rustical_dav::Error::PropReadOnly)
|
||||
}
|
||||
|
||||
fn get_path(&self) -> &str {
|
||||
&self.path
|
||||
}
|
||||
|
||||
@@ -60,10 +60,6 @@ impl Resource for RootFile {
|
||||
}
|
||||
}
|
||||
|
||||
fn set_prop(&mut self, _prop: Self::Prop) -> Result<(), rustical_dav::Error> {
|
||||
Err(rustical_dav::Error::PropReadOnly)
|
||||
}
|
||||
|
||||
fn get_path(&self) -> &str {
|
||||
&self.path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user