Fix a few principal urls

This commit is contained in:
Lennart
2024-06-30 20:35:08 +02:00
parent eda4cea4e6
commit b6debf2ad2
2 changed files with 12 additions and 13 deletions

View File

@@ -101,7 +101,7 @@ impl Resource for CalendarFile {
HrefElement::new(format!("{}/user/{}/", prefix, self.principal)),
)),
CalendarPropName::Owner => Ok(CalendarProp::Owner(HrefElement::new(format!(
"{}/{}/",
"{}/user/{}/",
prefix, self.principal
)))),
CalendarPropName::Displayname => {

View File

@@ -71,22 +71,21 @@ impl Resource for PrincipalFile {
type Error = Error;
fn get_prop(&self, prefix: &str, prop: Self::PropName) -> Result<Self::Prop, Self::Error> {
let principal_href = HrefElement::new(format!("{}/user/{}/", prefix, self.principal));
match prop {
PrincipalPropName::Resourcetype => {
Ok(PrincipalProp::Resourcetype(Resourcetype::default()))
}
PrincipalPropName::CurrentUserPrincipal => Ok(PrincipalProp::CurrentUserPrincipal(
HrefElement::new(format!("{}/{}/", prefix, self.principal)),
)),
PrincipalPropName::PrincipalUrl => Ok(PrincipalProp::PrincipalUrl(HrefElement::new(
format!("{}/user/{}/", prefix, self.principal),
))),
PrincipalPropName::CalendarHomeSet => Ok(PrincipalProp::CalendarHomeSet(
HrefElement::new(format!("{}/user/{}/", prefix, self.principal)),
)),
PrincipalPropName::CalendarUserAddressSet => Ok(PrincipalProp::CalendarUserAddressSet(
HrefElement::new(format!("{}/user/{}/", prefix, self.principal)),
)),
PrincipalPropName::CurrentUserPrincipal => {
Ok(PrincipalProp::CurrentUserPrincipal(principal_href))
}
PrincipalPropName::PrincipalUrl => Ok(PrincipalProp::PrincipalUrl(principal_href)),
PrincipalPropName::CalendarHomeSet => {
Ok(PrincipalProp::CalendarHomeSet(principal_href))
}
PrincipalPropName::CalendarUserAddressSet => {
Ok(PrincipalProp::CalendarUserAddressSet(principal_href))
}
}
}
}