From 1a1deeb5a2d68a4c33203a69cd1de03b8f8c41ec Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:06:38 +0200 Subject: [PATCH] mkcalendar: Support subscription url --- crates/caldav/src/calendar/methods/mkcalendar.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/caldav/src/calendar/methods/mkcalendar.rs b/crates/caldav/src/calendar/methods/mkcalendar.rs index e2f52ef..b7175e7 100644 --- a/crates/caldav/src/calendar/methods/mkcalendar.rs +++ b/crates/caldav/src/calendar/methods/mkcalendar.rs @@ -4,6 +4,7 @@ use crate::calendar::prop::SupportedCalendarComponentSet; use axum::extract::{Path, State}; use axum::response::{IntoResponse, Response}; use http::{Method, StatusCode}; +use rustical_dav::xml::HrefElement; use rustical_ical::CalendarObjectType; use rustical_store::auth::User; use rustical_store::{Calendar, CalendarStore, SubscriptionStore}; @@ -29,6 +30,8 @@ pub struct MkcolCalendarProp { resourcetype: Option, #[xml(ns = "rustical_dav::namespace::NS_CALDAV")] supported_calendar_component_set: Option, + #[xml(ns = "rustical_dav::namespace::NS_CALENDARSERVER")] + source: Option, // Ignore that property, we don't support it but also don't want to throw an error #[xml(ns = "rustical_dav::namespace::NS_CALDAV")] #[allow(dead_code)] @@ -86,7 +89,7 @@ pub async fn route_mkcalendar( description: request.calendar_description, deleted_at: None, synctoken: 0, - subscription_url: None, + subscription_url: request.source.map(|href| href.href), push_topic: uuid::Uuid::new_v4().to_string(), components: request .supported_calendar_component_set