Object quotas implementation

This commit is contained in:
mdecimus
2025-10-20 17:54:05 +02:00
parent 59ab6d91ab
commit ce836216a4
37 changed files with 967 additions and 652 deletions

View File

@@ -19,7 +19,7 @@ use dav_proto::schema::{
request::{DavPropertyValue, PropFind},
response::{Href, MultiStatus, PropStat, Response},
};
use directory::{QueryParams, Type, backend::internal::manage::ManageDirectory};
use directory::{PrincipalData, QueryParams, Type, backend::internal::manage::ManageDirectory};
use groupware::RFC_3986;
use groupware::cache::GroupwareCache;
use hyper::StatusCode;
@@ -124,11 +124,25 @@ impl PrincipalPropFind for Server {
.caused_by(trc::location!())?
.map(|p| {
let name = p.name;
let description = p.description.unwrap_or_else(|| name.clone());
let mut description = None;
let mut emails = Vec::new();
for data in p.data {
match data {
PrincipalData::Description(desc) => {
description = Some(desc);
}
PrincipalData::Email(email) => {
emails.push(email);
}
_ => {}
}
}
let description = description.unwrap_or_else(|| name.clone());
(
Cow::Owned(name.to_string()),
description.to_string(),
Cow::Owned(p.emails),
description,
Cow::Owned(emails),
p.typ,
)
})