Return CTag on /dav/cal/account resources (just to make iOS happy)

This commit is contained in:
mdecimus 2025-06-03 12:34:33 +02:00
parent cc78487fcb
commit 0c5581b1a9

View file

@ -10,7 +10,8 @@ use common::{Server, auth::AccessToken};
use dav_proto::schema::{
Namespace,
property::{
DavProperty, PrincipalProperty, Privilege, ReportSet, ResourceType, WebDavProperty,
DavProperty, DavValue, PrincipalProperty, Privilege, ReportSet, ResourceType,
WebDavProperty,
},
request::{DavPropertyValue, PropFind},
response::{Href, MultiStatus, PropStat, Response},
@ -193,6 +194,18 @@ impl PrincipalPropFind for Server {
fields.push(DavPropertyValue::new(property.clone(), sync_token));
}
WebDavProperty::GetCTag if !is_principal => {
let ctag = self
.fetch_dav_resources(access_token, account_id, collection.into())
.await
.caused_by(trc::location!())?
.highest_change_id;
fields.push(DavPropertyValue::new(
property.clone(),
DavValue::String(format!("\"{ctag}\"")),
));
}
WebDavProperty::Owner => {
fields.push(DavPropertyValue::new(
property.clone(),