mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 03:32:15 +00:00
typing
This commit is contained in:
@@ -88,7 +88,7 @@ pub async fn handle_calendar_multiget<C: CalendarStore + ?Sized>(
|
|||||||
let path = format!("{}/{}", req.path(), event.get_uid());
|
let path = format!("{}/{}", req.path(), event.get_uid());
|
||||||
responses.push(
|
responses.push(
|
||||||
EventResource::from(event)
|
EventResource::from(event)
|
||||||
.propfind(prefix, path, props.clone())
|
.propfind(prefix, &path, props.clone())
|
||||||
.await?,
|
.await?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
|
|||||||
let path = format!("{}/{}", req.path(), event.get_uid());
|
let path = format!("{}/{}", req.path(), event.get_uid());
|
||||||
responses.push(
|
responses.push(
|
||||||
EventResource::from(event)
|
EventResource::from(event)
|
||||||
.propfind(prefix, path, props.clone())
|
.propfind(prefix, &path, props.clone())
|
||||||
.await?,
|
.await?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
|
|||||||
let path = format!("{}/{}", req.path(), event.get_uid());
|
let path = format!("{}/{}", req.path(), event.get_uid());
|
||||||
responses.push(
|
responses.push(
|
||||||
EventResource::from(event)
|
EventResource::from(event)
|
||||||
.propfind(prefix, path, props.clone())
|
.propfind(prefix, &path, props.clone())
|
||||||
.await?,
|
.await?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ pub async fn route_propfind<A: CheckAuthentication, R: ResourceService>(
|
|||||||
> {
|
> {
|
||||||
debug!("{body}");
|
debug!("{body}");
|
||||||
let prefix = prefix.into_inner();
|
let prefix = prefix.into_inner();
|
||||||
let path = req.path().to_owned();
|
|
||||||
|
|
||||||
let resource_service = R::new(&req, path_components.into_inner()).await?;
|
let resource_service = R::new(&req, path_components.into_inner()).await?;
|
||||||
|
|
||||||
@@ -83,12 +82,12 @@ pub async fn route_propfind<A: CheckAuthentication, R: ResourceService>(
|
|||||||
let mut member_responses = Vec::new();
|
let mut member_responses = Vec::new();
|
||||||
if depth != Depth::Zero {
|
if depth != Depth::Zero {
|
||||||
for (path, member) in resource_service.get_members().await? {
|
for (path, member) in resource_service.get_members().await? {
|
||||||
member_responses.push(member.propfind(&prefix, path, props.clone()).await?);
|
member_responses.push(member.propfind(&prefix, &path, props.clone()).await?);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let resource = resource_service.get_resource(auth.inner.user_id).await?;
|
let resource = resource_service.get_resource(auth.inner.user_id).await?;
|
||||||
let response = resource.propfind(&prefix, path, props).await?;
|
let response = resource.propfind(&prefix, req.path(), props).await?;
|
||||||
|
|
||||||
Ok(MultistatusElement {
|
Ok(MultistatusElement {
|
||||||
responses: vec![response],
|
responses: vec![response],
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pub trait HandlePropfind {
|
|||||||
async fn propfind(
|
async fn propfind(
|
||||||
&self,
|
&self,
|
||||||
prefix: &str,
|
prefix: &str,
|
||||||
path: String,
|
path: &str,
|
||||||
props: Vec<&str>,
|
props: Vec<&str>,
|
||||||
) -> Result<impl Serialize, Self::Error>;
|
) -> Result<impl Serialize, Self::Error>;
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ impl<R: Resource> HandlePropfind for R {
|
|||||||
async fn propfind(
|
async fn propfind(
|
||||||
&self,
|
&self,
|
||||||
prefix: &str,
|
prefix: &str,
|
||||||
path: String,
|
path: &str,
|
||||||
mut props: Vec<&str>,
|
mut props: Vec<&str>,
|
||||||
) -> Result<ResponseElement<PropstatWrapper<R::Prop>>, R::Error> {
|
) -> Result<ResponseElement<PropstatWrapper<R::Prop>>, R::Error> {
|
||||||
if props.contains(&"propname") {
|
if props.contains(&"propname") {
|
||||||
@@ -94,7 +94,7 @@ impl<R: Resource> HandlePropfind for R {
|
|||||||
.map(|&prop| prop.to_string())
|
.map(|&prop| prop.to_string())
|
||||||
.collect();
|
.collect();
|
||||||
return Ok(ResponseElement {
|
return Ok(ResponseElement {
|
||||||
href: path,
|
href: path.to_owned(),
|
||||||
propstat: vec![PropstatWrapper::TagList(PropstatElement {
|
propstat: vec![PropstatWrapper::TagList(PropstatElement {
|
||||||
prop: TagList::from(props),
|
prop: TagList::from(props),
|
||||||
status: format!("HTTP/1.1 {}", StatusCode::OK),
|
status: format!("HTTP/1.1 {}", StatusCode::OK),
|
||||||
@@ -147,7 +147,7 @@ impl<R: Resource> HandlePropfind for R {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
Ok(ResponseElement {
|
Ok(ResponseElement {
|
||||||
href: path,
|
href: path.to_owned(),
|
||||||
propstat: propstats,
|
propstat: propstats,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user