aboutsummaryrefslogtreecommitdiff
path: root/aero-proto/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-05-27 18:16:53 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-05-27 18:16:53 +0200
commit5b1da2a33b265b674a130a90377c289faea7a210 (patch)
treee3c5ec8bc0745d978fd49ddc60d7e9170055dc9f /aero-proto/src
parent418adf92be86ea83008a145180837f1e0ad3018a (diff)
downloadaerogramme-5b1da2a33b265b674a130a90377c289faea7a210.tar.gz
aerogramme-5b1da2a33b265b674a130a90377c289faea7a210.zip
webdav sync core codec
Diffstat (limited to 'aero-proto/src')
-rw-r--r--aero-proto/src/dav/controller.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/aero-proto/src/dav/controller.rs b/aero-proto/src/dav/controller.rs
index eeb6d43..1b7f7ee 100644
--- a/aero-proto/src/dav/controller.rs
+++ b/aero-proto/src/dav/controller.rs
@@ -9,8 +9,9 @@ use hyper::{body::Bytes, Request, Response};
use aero_collections::user::User;
use aero_dav::caltypes as cal;
-use aero_dav::realization::All;
+use aero_dav::realization::{self, All};
use aero_dav::types as dav;
+use aero_dav::versioningtypes as vers;
use aero_ical::query::is_component_match;
use crate::dav::codec;
@@ -95,7 +96,7 @@ impl Controller {
async fn report(self) -> Result<HttpResponse> {
let status = hyper::StatusCode::from_u16(207)?;
- let report = match deserialize::<cal::Report<All>>(self.req).await {
+ let cal_report = match deserialize::<vers::Report<All>>(self.req).await {
Ok(v) => v,
Err(e) => {
tracing::error!(err=?e, "unable to decode REPORT body");
@@ -110,8 +111,8 @@ impl Controller {
let calprop: Option<cal::CalendarSelector<All>>;
// Extracting request information
- match report {
- cal::Report::Multiget(m) => {
+ match cal_report {
+ vers::Report::Extension(realization::ReportType::Cal(cal::ReportType::Multiget(m))) => {
// Multiget is really like a propfind where Depth: 0|1|Infinity is replaced by an arbitrary
// list of URLs
// Getting the list of nodes
@@ -136,13 +137,16 @@ impl Controller {
}
calprop = m.selector;
}
- cal::Report::Query(q) => {
+ vers::Report::Extension(realization::ReportType::Cal(cal::ReportType::Query(q))) => {
calprop = q.selector;
ok_node = apply_filter(self.node.children(&self.user).await, &q.filter)
.try_collect()
.await?;
}
- cal::Report::FreeBusy(_) => {
+ vers::Report::Extension(realization::ReportType::Sync(_sync_col)) => {
+ todo!()
+ }
+ _ => {
return Ok(Response::builder()
.status(501)
.body(text_body("Not implemented"))?)