Rename events to calendar objects

This commit is contained in:
Lennart
2024-10-03 15:59:19 +02:00
parent 24419397c3
commit 6eaaae37b3
24 changed files with 394 additions and 44 deletions

View File

@@ -160,7 +160,7 @@ pub struct CalendarQueryRequest {
timezone: Option<String>,
}
pub async fn get_events_calendar_query<C: CalendarStore + ?Sized>(
pub async fn get_objects_calendar_query<C: CalendarStore + ?Sized>(
cal_query: &CalendarQueryRequest,
principal: &str,
cid: &str,
@@ -181,7 +181,7 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
cid: &str,
cal_store: &RwLock<C>,
) -> Result<MultistatusElement<PropstatWrapper<CalendarObjectProp>, String>, Error> {
let events = get_events_calendar_query(&cal_query, principal, cid, cal_store).await?;
let objects = get_objects_calendar_query(&cal_query, principal, cid, cal_store).await?;
let props = match cal_query.prop {
PropfindType::Allprop => {
@@ -196,10 +196,10 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
let props: Vec<&str> = props.iter().map(String::as_str).collect();
let mut responses = Vec::new();
for event in events {
let path = format!("{}/{}", req.path(), event.get_uid());
for object in objects {
let path = format!("{}/{}", req.path(), object.get_uid());
responses.push(
CalendarObjectResource::from(event)
CalendarObjectResource::from(object)
.propfind(prefix, &path, props.clone())
.await?,
);