diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-28 12:38:22 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-28 12:38:22 +0200 |
commit | 1c9d2eab6976993c85eaa3e8eb4f1c433258fd16 (patch) | |
tree | 6e29fdc6a465295f2142163744e8851a1cb5e95a /aero-dav/src/caldecoder.rs | |
parent | 5b1da2a33b265b674a130a90377c289faea7a210 (diff) | |
download | aerogramme-1c9d2eab6976993c85eaa3e8eb4f1c433258fd16.tar.gz aerogramme-1c9d2eab6976993c85eaa3e8eb4f1c433258fd16.zip |
parse property for sync + versioning
Diffstat (limited to 'aero-dav/src/caldecoder.rs')
-rw-r--r-- | aero-dav/src/caldecoder.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/aero-dav/src/caldecoder.rs b/aero-dav/src/caldecoder.rs index ff79845..0df867f 100644 --- a/aero-dav/src/caldecoder.rs +++ b/aero-dav/src/caldecoder.rs @@ -104,6 +104,28 @@ impl QRead<FreeBusyQuery> for FreeBusyQuery { } } +impl QRead<ReportTypeName> for ReportTypeName { + async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> { + if xml.maybe_open(DAV_URN, "calendar-query").await?.is_some() { + xml.close().await?; + return Ok(Self::Query); + } + if xml + .maybe_open(DAV_URN, "calendar-multiget") + .await? + .is_some() + { + xml.close().await?; + return Ok(Self::Multiget); + } + if xml.maybe_open(DAV_URN, "free-busy-query").await?.is_some() { + xml.close().await?; + return Ok(Self::FreeBusy); + } + Err(ParsingError::Recoverable) + } +} + // ---- EXTENSIONS --- impl QRead<Violation> for Violation { async fn qread(xml: &mut Reader<impl IRead>) -> Result<Self, ParsingError> { |