Skip to content

caldav: add support for more props on MKCOL and PROPFIND - #211

Open
mrusme wants to merge 1 commit into
emersion:masterfrom
mrusme:feat/create-calendar-props
Open

caldav: add support for more props on MKCOL and PROPFIND#211
mrusme wants to merge 1 commit into
emersion:masterfrom
mrusme:feat/create-calendar-props

Conversation

@mrusme

@mrusme mrusme commented Jul 27, 2026

Copy link
Copy Markdown

Read calendar-description, calendar-timezone, calendar-color and supported-calendar-component-set from a MKCOL request body, and report the color and the timezone in PROPFIND responses.

Each property in the request body is matched together with its namespace. A flat "set>prop>name" struct tag cannot do that, because encoding/xml checks the namespace of such a tag against every element along the path rather than against the last one: naming one there matches nothing, and leaving it out matches the element in any namespace. The body is decoded through nested types instead.

Calendar.Timezone is a parsed *ical.Calendar. RFC 4791 section 5.2.2 requires the property value to be an iCalendar object with exactly one VTIMEZONE component, and a value that is not one is rejected with the CALDAV:valid-calendar-data precondition of section 5.3.1.1.

calendar-color belongs to Apple rather than to CalDAV, and is read and reported in the http://apple.com/ns/ical/ namespace.

//edit: This is a follow-up on #150 to make it clear and it was originally authored by @DeepDiver1975.

Read calendar-description, calendar-timezone, calendar-color and
supported-calendar-component-set from a MKCOL request body, and report
the color and the timezone in PROPFIND responses.

Each property in the request body is matched together with its
namespace. A flat "set>prop>name" struct tag cannot do that, because
encoding/xml checks the namespace of such a tag against every element
along the path rather than against the last one: naming one there
matches nothing, and leaving it out matches the element in any
namespace. The body is decoded through nested types instead.

Calendar.Timezone is a parsed *ical.Calendar. RFC 4791 section 5.2.2
requires the property value to be an iCalendar object with exactly one
VTIMEZONE component, and a value that is not one is rejected with the
CALDAV:valid-calendar-data precondition of section 5.3.1.1.

calendar-color belongs to Apple rather than to CalDAV, and is read and
reported in the http://apple.com/ns/ical/ namespace.
@mrusme mrusme closed this Jul 27, 2026
@mrusme
mrusme deleted the feat/create-calendar-props branch July 27, 2026 14:08
@mrusme
mrusme restored the feat/create-calendar-props branch July 27, 2026 16:18
@mrusme mrusme reopened this Jul 27, 2026
@mrusme mrusme closed this Jul 27, 2026
@mrusme
mrusme deleted the feat/create-calendar-props branch July 27, 2026 22:18
@mrusme
mrusme restored the feat/create-calendar-props branch July 31, 2026 09:07
@mrusme mrusme reopened this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants