-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
caldav: add support for more props on MKCOL and PROPFIND #150
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,16 @@ var ( | |
calendarQueryName = xml.Name{namespace, "calendar-query"} | ||
calendarMultigetName = xml.Name{namespace, "calendar-multiget"} | ||
|
||
calendarName = xml.Name{namespace, "calendar"} | ||
calendarDataName = xml.Name{namespace, "calendar-data"} | ||
calendarName = xml.Name{namespace, "calendar"} | ||
calendarDataName = xml.Name{namespace, "calendar-data"} | ||
calendarColorName = xml.Name{ | ||
Space: "http://apple.com/ns/ical/", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The standard way to set the color of a calendar is: https://datatracker.ietf.org/doc/html/rfc7986#section-5.9 This is a non-standard, Apple-specfic property. I'm not sure I want to support it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I never saw this one in real life. But happy to add this as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just adding my 2 cents: I have indeed also observed the proliferation of this pseudo-standard (apple.com/ns/ical) into many open-source clients (e.g. DavX5 sets it on MKCOL). On the other hand, from my experience, after initial calendar creation, this is treated as a pure client-side property by pretty much all clients (i.e. it never gets updated again), so not sure how necessary it really is... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
agreed - this is for sure a pretty low feature. e.g. on the owncloud 10 codebase (php+sabredav) colors are the same on all clients (owncloud calendar app in web, DAVx and iOS) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, actually it doesn't seem like there is any standard way to fetch a Oh well, let's just do like everybody else then… |
||
Local: "calendar-color", | ||
} | ||
calendarTimezoneName = xml.Name{ | ||
Space: namespace, | ||
Local: "calendar-timezone", | ||
} | ||
) | ||
|
||
// https://tools.ietf.org/html/rfc4791#section-6.2.1 | ||
|
@@ -41,6 +49,16 @@ type calendarDescription struct { | |
Description string `xml:",chardata"` | ||
} | ||
|
||
type calendarColor struct { | ||
XMLName xml.Name `xml:"http://apple.com/ns/ical/ calendar-color"` | ||
Color string `xml:",chardata"` | ||
} | ||
|
||
type calendarTimezone struct { | ||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:caldav calendar-timezone"` | ||
Timezone string `xml:",chardata"` | ||
} | ||
|
||
// https://tools.ietf.org/html/rfc4791#section-5.2.4 | ||
type supportedCalendarData struct { | ||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:caldav supported-calendar-data"` | ||
|
@@ -230,8 +248,11 @@ func (r *reportReq) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { | |
} | ||
|
||
type mkcolReq struct { | ||
XMLName xml.Name `xml:"DAV: mkcol"` | ||
ResourceType internal.ResourceType `xml:"set>prop>resourcetype"` | ||
DisplayName string `xml:"set>prop>displayname"` | ||
// TODO this could theoretically contain all addressbook properties? | ||
XMLName xml.Name `xml:"DAV: mkcol"` | ||
ResourceType internal.ResourceType `xml:"set>prop>resourcetype"` | ||
DisplayName string `xml:"set>prop>displayname"` | ||
Description string `xml:"set>prop>calendar-description"` | ||
CalendarColor string `xml:"set>prop>calendar-color"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably specify the |
||
CalendarTimeZone string `xml:"set>prop>calendar-timezone"` | ||
SupportedCalendarComponentSet supportedCalendarComponentSet `xml:"set>prop>supported-calendar-component-set"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a parsed
*ical.Calendar
?We should probably check that the parsed value contains exactly one
VTIMEZONE
component?