Refactoring

This commit is contained in:
Lennart
2024-11-06 15:57:10 +01:00
parent ae4d5f0fc6
commit c21993ab15
17 changed files with 85 additions and 128 deletions

View File

@@ -9,12 +9,9 @@ use actix_web::{
HttpRequest,
};
use rustical_dav::{
methods::propfind::{PropElement, PropfindType},
resource::{CommonPropertiesProp, EitherProp, Resource},
xml::{
multistatus::{PropstatWrapper, ResponseElement},
MultistatusElement,
},
xml::{multistatus::ResponseElement, MultistatusElement},
xml::{PropElement, PropfindType},
};
use rustical_store::{auth::User, AddressObject, AddressbookStore};
use serde::Deserialize;
@@ -68,13 +65,8 @@ pub async fn handle_addressbook_multiget<AS: AddressbookStore + ?Sized>(
principal: &str,
cal_id: &str,
addr_store: &AS,
) -> Result<
MultistatusElement<
PropstatWrapper<EitherProp<AddressObjectProp, CommonPropertiesProp>>,
String,
>,
Error,
> {
) -> Result<MultistatusElement<EitherProp<AddressObjectProp, CommonPropertiesProp>, String>, Error>
{
let principal_url = PrincipalResource::get_url(req.resource_map(), vec![principal]).unwrap();
let (objects, not_found) = get_objects_addressbook_multiget(
&addr_multiget,

View File

@@ -4,12 +4,9 @@ use crate::{
};
use actix_web::{http::StatusCode, HttpRequest};
use rustical_dav::{
methods::propfind::{PropElement, PropfindType},
resource::{CommonPropertiesProp, EitherProp, Resource},
xml::{
multistatus::{PropstatWrapper, ResponseElement},
MultistatusElement,
},
xml::{multistatus::ResponseElement, MultistatusElement},
xml::{PropElement, PropfindType},
};
use rustical_store::{
auth::User,
@@ -47,13 +44,8 @@ pub async fn handle_sync_collection<AS: AddressbookStore + ?Sized>(
principal: &str,
addressbook_id: &str,
addr_store: &AS,
) -> Result<
MultistatusElement<
PropstatWrapper<EitherProp<AddressObjectProp, CommonPropertiesProp>>,
String,
>,
Error,
> {
) -> Result<MultistatusElement<EitherProp<AddressObjectProp, CommonPropertiesProp>, String>, Error>
{
let props = match sync_collection.prop {
PropfindType::Allprop => {
vec!["allprop".to_owned()]