mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 04:42:15 +00:00
Add first VTODO support
This commit is contained in:
@@ -115,9 +115,14 @@ impl Resource for CalendarResource {
|
||||
CalendarPropName::CalendarOrder => CalendarProp::CalendarOrder(Some(self.0.order)),
|
||||
CalendarPropName::SupportedCalendarComponentSet => {
|
||||
CalendarProp::SupportedCalendarComponentSet(SupportedCalendarComponentSet {
|
||||
comp: vec![SupportedCalendarComponent {
|
||||
name: "VEVENT".to_owned(),
|
||||
}],
|
||||
comp: vec![
|
||||
SupportedCalendarComponent {
|
||||
name: "VEVENT".to_owned(),
|
||||
},
|
||||
SupportedCalendarComponent {
|
||||
name: "VTODO".to_owned(),
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
CalendarPropName::SupportedCalendarData => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod calendar;
|
||||
pub mod event;
|
||||
pub mod object;
|
||||
pub mod todo;
|
||||
|
||||
pub use calendar::Calendar;
|
||||
pub use object::CalendarObject;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use super::event::EventObject;
|
||||
use super::{event::EventObject, todo::TodoObject};
|
||||
use crate::Error;
|
||||
use anyhow::Result;
|
||||
use ical::parser::ical::component::IcalTodo;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::io::BufReader;
|
||||
@@ -14,11 +13,6 @@ pub enum CalendarObjectType {
|
||||
Todo,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TodoObject {
|
||||
todo: IcalTodo,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum CalendarObjectComponent {
|
||||
Event(EventObject),
|
||||
@@ -126,4 +120,11 @@ impl CalendarObject {
|
||||
pub fn get_ics(&self) -> &str {
|
||||
&self.ics
|
||||
}
|
||||
|
||||
pub fn get_component_name(&self) -> &str {
|
||||
match self.data {
|
||||
CalendarObjectComponent::Todo(_) => "VTODO",
|
||||
CalendarObjectComponent::Event(_) => "VEVENT",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
crates/store/src/model/todo.rs
Normal file
6
crates/store/src/model/todo.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
use ical::parser::ical::component::IcalTodo;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TodoObject {
|
||||
pub(crate) todo: IcalTodo,
|
||||
}
|
||||
Reference in New Issue
Block a user