mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 14:02:29 +00:00
Remove member principals from calendar-home-set
This commit is contained in:
@@ -49,14 +49,6 @@ impl Resource for PrincipalResource {
|
|||||||
) -> Result<Self::Prop, Self::Error> {
|
) -> Result<Self::Prop, Self::Error> {
|
||||||
let principal_url = puri.principal_uri(&self.principal.id);
|
let principal_url = puri.principal_uri(&self.principal.id);
|
||||||
|
|
||||||
let home_set = CalendarHomeSet(
|
|
||||||
self.principal
|
|
||||||
.memberships()
|
|
||||||
.into_iter()
|
|
||||||
.map(|principal| puri.principal_uri(principal).into())
|
|
||||||
.collect(),
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(match prop {
|
Ok(match prop {
|
||||||
PrincipalPropWrapperName::Principal(prop) => {
|
PrincipalPropWrapperName::Principal(prop) => {
|
||||||
PrincipalPropWrapper::Principal(match prop {
|
PrincipalPropWrapper::Principal(match prop {
|
||||||
@@ -66,7 +58,9 @@ impl Resource for PrincipalResource {
|
|||||||
PrincipalPropName::PrincipalUrl => {
|
PrincipalPropName::PrincipalUrl => {
|
||||||
PrincipalProp::PrincipalUrl(principal_url.into())
|
PrincipalProp::PrincipalUrl(principal_url.into())
|
||||||
}
|
}
|
||||||
PrincipalPropName::CalendarHomeSet => PrincipalProp::CalendarHomeSet(home_set),
|
PrincipalPropName::CalendarHomeSet => {
|
||||||
|
PrincipalProp::CalendarHomeSet(principal_url.into())
|
||||||
|
}
|
||||||
PrincipalPropName::CalendarUserAddressSet => {
|
PrincipalPropName::CalendarUserAddressSet => {
|
||||||
PrincipalProp::CalendarUserAddressSet(principal_url.into())
|
PrincipalProp::CalendarUserAddressSet(principal_url.into())
|
||||||
}
|
}
|
||||||
@@ -89,9 +83,7 @@ impl Resource for PrincipalResource {
|
|||||||
}
|
}
|
||||||
PrincipalPropName::AlternateUriSet => PrincipalProp::AlternateUriSet,
|
PrincipalPropName::AlternateUriSet => PrincipalProp::AlternateUriSet,
|
||||||
PrincipalPropName::PrincipalCollectionSet => {
|
PrincipalPropName::PrincipalCollectionSet => {
|
||||||
PrincipalProp::PrincipalCollectionSet(PrincipalCollectionSet(
|
PrincipalProp::PrincipalCollectionSet(puri.principal_collection().into())
|
||||||
puri.principal_collection().into(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
PrincipalPropName::SupportedReportSet => {
|
PrincipalPropName::SupportedReportSet => {
|
||||||
PrincipalProp::SupportedReportSet(SupportedReportSet::all())
|
PrincipalProp::SupportedReportSet(SupportedReportSet::all())
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ pub enum PrincipalProp {
|
|||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV", rename = b"alternate-URI-set")]
|
#[xml(ns = "rustical_dav::namespace::NS_DAV", rename = b"alternate-URI-set")]
|
||||||
AlternateUriSet,
|
AlternateUriSet,
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||||
PrincipalCollectionSet(PrincipalCollectionSet),
|
PrincipalCollectionSet(HrefElement),
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV", skip_deserializing)]
|
#[xml(ns = "rustical_dav::namespace::NS_DAV", skip_deserializing)]
|
||||||
SupportedReportSet(SupportedReportSet<ReportMethod>),
|
SupportedReportSet(SupportedReportSet<ReportMethod>),
|
||||||
|
|
||||||
// CalDAV (RFC 4791)
|
// CalDAV (RFC 4791)
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||||
CalendarHomeSet(CalendarHomeSet),
|
CalendarHomeSet(HrefElement),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone, EnumVariants, PropName)]
|
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone, EnumVariants, PropName)]
|
||||||
@@ -41,18 +41,12 @@ pub enum PrincipalPropWrapper {
|
|||||||
Common(CommonPropertiesProp),
|
Common(CommonPropertiesProp),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
|
||||||
pub struct CalendarHomeSet(#[xml(ty = "untagged", flatten)] pub(super) Vec<HrefElement>);
|
|
||||||
|
|
||||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
||||||
pub struct GroupMembership(#[xml(ty = "untagged", flatten)] pub(super) Vec<HrefElement>);
|
pub struct GroupMembership(#[xml(ty = "untagged", flatten)] pub(super) Vec<HrefElement>);
|
||||||
|
|
||||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
||||||
pub struct GroupMemberSet(#[xml(ty = "untagged", flatten)] pub(super) Vec<HrefElement>);
|
pub struct GroupMemberSet(#[xml(ty = "untagged", flatten)] pub(super) Vec<HrefElement>);
|
||||||
|
|
||||||
#[derive(XmlDeserialize, XmlSerialize, PartialEq, Clone)]
|
|
||||||
pub struct PrincipalCollectionSet(#[xml(ty = "untagged")] pub(super) HrefElement);
|
|
||||||
|
|
||||||
#[derive(XmlSerialize, PartialEq, Clone, VariantArray)]
|
#[derive(XmlSerialize, PartialEq, Clone, VariantArray)]
|
||||||
pub enum ReportMethod {
|
pub enum ReportMethod {
|
||||||
// We don't actually support principal-match
|
// We don't actually support principal-match
|
||||||
|
|||||||
Reference in New Issue
Block a user