mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 03:32:15 +00:00
caldav principal: Add displayname and calendar-user-type
This commit is contained in:
@@ -25,6 +25,15 @@ pub struct CalendarHomeSet(#[xml(ty = "untagged", flatten)] Vec<HrefElement>);
|
|||||||
strum(serialize_all = "kebab-case")
|
strum(serialize_all = "kebab-case")
|
||||||
)]
|
)]
|
||||||
pub enum PrincipalProp {
|
pub enum PrincipalProp {
|
||||||
|
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||||
|
Displayname(String),
|
||||||
|
|
||||||
|
// Scheduling Extensions to CalDAV (RFC 6638)
|
||||||
|
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||||
|
CalendarUserType(&'static str),
|
||||||
|
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||||
|
CalendarUserAddressSet(HrefElement),
|
||||||
|
|
||||||
// WebDAV Access Control (RFC 3744)
|
// WebDAV Access Control (RFC 3744)
|
||||||
#[strum_discriminants(strum(serialize = "principal-URL"))]
|
#[strum_discriminants(strum(serialize = "principal-URL"))]
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||||
@@ -33,8 +42,6 @@ pub enum PrincipalProp {
|
|||||||
// CalDAV (RFC 4791)
|
// CalDAV (RFC 4791)
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||||
CalendarHomeSet(CalendarHomeSet),
|
CalendarHomeSet(CalendarHomeSet),
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
|
||||||
CalendarUserAddressSet(HrefElement),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PrincipalResource {
|
impl PrincipalResource {
|
||||||
@@ -77,6 +84,8 @@ impl Resource for PrincipalResource {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Ok(match prop {
|
Ok(match prop {
|
||||||
|
PrincipalPropName::CalendarUserType => PrincipalProp::CalendarUserType("INDIVIDUAL"),
|
||||||
|
PrincipalPropName::Displayname => PrincipalProp::Displayname(self.principal.to_owned()),
|
||||||
PrincipalPropName::PrincipalUrl => PrincipalProp::PrincipalUrl(principal_url.into()),
|
PrincipalPropName::PrincipalUrl => PrincipalProp::PrincipalUrl(principal_url.into()),
|
||||||
PrincipalPropName::CalendarHomeSet => PrincipalProp::CalendarHomeSet(home_set),
|
PrincipalPropName::CalendarHomeSet => PrincipalProp::CalendarHomeSet(home_set),
|
||||||
PrincipalPropName::CalendarUserAddressSet => {
|
PrincipalPropName::CalendarUserAddressSet => {
|
||||||
|
|||||||
Reference in New Issue
Block a user