CalDAV query, freebusy and expand-property reports
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user