CalDAV query, freebusy and expand-property reports

This commit is contained in:
mdecimus
2025-04-27 18:13:28 +02:00
parent e10e94325f
commit f74ec98c0d
61 changed files with 2424 additions and 693 deletions

View File

@@ -19,6 +19,7 @@ mail-auth = { version = "0.6" }
mail-send = { version = "0.5", default-features = false, features = ["cram-md5", "ring", "tls12"] }
smtp-proto = { version = "0.1", features = ["rkyv"] }
dns-update = { version = "0.1" }
calcard = { path = "/Users/me/code/calcard", features = ["rkyv"] }
ahash = { version = "0.8.2", features = ["serde"] }
parking_lot = "0.12.1"
regex = "1.7.0"

View File

@@ -19,6 +19,7 @@ use std::{
use ahash::{AHashMap, AHashSet};
use arc_swap::ArcSwap;
use auth::{AccessToken, oauth::config::OAuthConfig, roles::RolePermissions};
use calcard::common::timezone::Tz;
use config::{
dav::DavConfig,
imap::ImapConfig,
@@ -268,6 +269,9 @@ pub enum DavResourceMetadata {
is_container: bool,
},
Calendar {
tz: Tz,
},
CalendarEvent {
start: i64,
duration: u32,
},
@@ -542,13 +546,20 @@ impl DavResources {
impl DavResource {
pub fn event_time_range(&self) -> Option<(i64, i64)> {
match &self.data {
DavResourceMetadata::Calendar { start, duration } => {
DavResourceMetadata::CalendarEvent { start, duration } => {
Some((*start, *start + *duration as i64))
}
_ => None,
}
}
pub fn timezone(&self) -> Option<Tz> {
match &self.data {
DavResourceMetadata::Calendar { tz } => Some(*tz),
_ => None,
}
}
pub fn is_container(&self) -> bool {
match &self.data {
DavResourceMetadata::File { is_container, .. } => *is_container,