Remove all that extension business and replace with internal properties

This commit is contained in:
Lennart
2024-11-05 17:22:48 +01:00
parent 4da0ca34c7
commit d5ef6669a6
21 changed files with 176 additions and 264 deletions

View File

@@ -10,7 +10,7 @@ use actix_web::{
};
use rustical_dav::{
methods::propfind::{PropElement, PropfindType},
resource::Resource,
resource::{CommonPropertiesProp, EitherProp, Resource},
xml::{
multistatus::{PropstatWrapper, ResponseElement},
MultistatusElement,
@@ -69,7 +69,13 @@ pub async fn handle_calendar_multiget<C: CalendarStore + ?Sized>(
principal: &str,
cal_id: &str,
cal_store: &C,
) -> Result<MultistatusElement<PropstatWrapper<CalendarObjectProp>, String>, Error> {
) -> Result<
MultistatusElement<
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
String,
>,
Error,
> {
let principal_url = PrincipalResource::get_url(req.resource_map(), vec![principal]).unwrap();
let (objects, not_found) =
get_objects_calendar_multiget(&cal_multiget, &principal_url, principal, cal_id, cal_store)

View File

@@ -2,7 +2,7 @@ use actix_web::HttpRequest;
use chrono::{DateTime, Utc};
use rustical_dav::{
methods::propfind::{PropElement, PropfindType},
resource::Resource,
resource::{CommonPropertiesProp, EitherProp, Resource},
xml::{multistatus::PropstatWrapper, MultistatusElement},
};
use rustical_store::{auth::User, CalendarObject, CalendarStore};
@@ -210,7 +210,13 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
principal: &str,
cal_id: &str,
cal_store: &C,
) -> Result<MultistatusElement<PropstatWrapper<CalendarObjectProp>, String>, Error> {
) -> Result<
MultistatusElement<
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
String,
>,
Error,
> {
let objects = get_objects_calendar_query(&cal_query, principal, cal_id, cal_store).await?;
let props = match cal_query.prop {

View File

@@ -1,7 +1,7 @@
use actix_web::{http::StatusCode, HttpRequest};
use rustical_dav::{
methods::propfind::{PropElement, PropfindType},
resource::Resource,
resource::{CommonPropertiesProp, EitherProp, Resource},
xml::{
multistatus::{PropstatWrapper, ResponseElement},
MultistatusElement,
@@ -49,7 +49,13 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
principal: &str,
cal_id: &str,
cal_store: &C,
) -> Result<MultistatusElement<PropstatWrapper<CalendarObjectProp>, String>, Error> {
) -> Result<
MultistatusElement<
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
String,
>,
Error,
> {
let props = match sync_collection.prop {
PropfindType::Allprop => {
vec!["allprop".to_owned()]