Add namespace

This commit is contained in:
Lennart
2024-12-31 20:06:10 +01:00
parent 5cacca9046
commit b7f090e467
3 changed files with 10 additions and 2 deletions

View File

@@ -66,11 +66,13 @@ pub enum CalendarProp {
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
#[xml(skip_deserializing)]
SupportedCalendarComponentSet(SupportedCalendarComponentSet),
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
#[xml(skip_deserializing)]
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
SupportedCalendarData(SupportedCalendarData),
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
MaxResourceSize(i64),
#[xml(skip_deserializing)]
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
SupportedReportSet(SupportedReportSet),
// Collection Synchronization (RFC 6578)

View File

@@ -68,6 +68,7 @@ impl Resource for AddressbookResource {
type PrincipalResource = PrincipalResource;
fn get_resourcetype(&self) -> &'static [&'static str] {
// TODO: namespace
&["collection", "CARD:addressbook"]
}

View File

@@ -87,7 +87,12 @@ impl<PT: XmlSerialize> Default for ResponseElement<PT> {
// Extended by sync-token as specified in RFC 6578
#[derive(XmlSerialize, XmlRootTag)]
#[xml(root = b"multistatus", ns = "crate::namespace::NS_DAV")]
#[xml(ns_prefix(crate::namespace::NS_DAV = b"D"))]
#[xml(ns_prefix(
crate::namespace::NS_DAV = b"D",
crate::namespace::NS_CARDDAV = b"CARD",
crate::namespace::NS_CALDAV = b"CAL",
crate::namespace::NS_CALENDARSERVER = b"CS"
))]
pub struct MultistatusElement<PropType: XmlSerialize, MemberPropType: XmlSerialize> {
#[xml(rename = b"response", flatten)]
pub responses: Vec<ResponseElement<PropType>>,