Replace janky calendar-multiget implementation with antother janky implementation

This commit is contained in:
Lennart
2024-06-01 14:50:08 +02:00
parent 41526b9f26
commit abfc03802d

View File

@@ -28,6 +28,7 @@ pub enum PropQuery {
#[derive(Deserialize, Clone, Debug)] #[derive(Deserialize, Clone, Debug)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
#[allow(dead_code)]
// <!ELEMENT calendar-query ((DAV:allprop | DAV:propname | DAV:prop)?, href+)> // <!ELEMENT calendar-query ((DAV:allprop | DAV:propname | DAV:prop)?, href+)>
pub struct CalendarMultigetRequest { pub struct CalendarMultigetRequest {
#[serde(flatten)] #[serde(flatten)]
@@ -128,17 +129,19 @@ async fn get_events_calendar_query<C: CalendarStore + ?Sized>(
} }
async fn get_events_calendar_multiget<C: CalendarStore + ?Sized>( async fn get_events_calendar_multiget<C: CalendarStore + ?Sized>(
cal_query: CalendarMultigetRequest, _cal_query: CalendarMultigetRequest,
_cid: &str, cid: &str,
_store: &RwLock<C>, store: &RwLock<C>,
) -> Result<Vec<Event>, Error> { ) -> Result<Vec<Event>, Error> {
let events = Vec::new(); // TODO: proper implementation
for href in cal_query.href { Ok(store.read().await.get_events(cid).await?)
dbg!(href); // let events = Vec::new();
// let uid = // for href in cal_query.href {
// events.push(store.read().await.get_event(cid, &uid)) // dbg!(href);
} // // let uid =
Ok(events) // // events.push(store.read().await.get_event(cid, &uid))
// }
// Ok(events)
} }
pub async fn route_report_calendar<A: CheckAuthentication, C: CalendarStore + ?Sized>( pub async fn route_report_calendar<A: CheckAuthentication, C: CalendarStore + ?Sized>(