Skip to content

Commit

Permalink
ResourceType: add CS:calendar-proxy-read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc2822 committed Oct 23, 2023
1 parent 8bba5ef commit 9cf4ef3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/kotlin/at/bitfire/dav4jvm/property/ResourceType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class ResourceType: Property {
val PRINCIPAL = Property.Name(XmlUtils.NS_WEBDAV, "principal") // WebDAV ACL
val ADDRESSBOOK = Property.Name(XmlUtils.NS_CARDDAV, "addressbook") // CardDAV
val CALENDAR = Property.Name(XmlUtils.NS_CALDAV, "calendar") // CalDAV

// CalendarServer extensions
val CALENDAR_PROXY_READ = Property.Name(XmlUtils.NS_CALENDARSERVER, "calendar-proxy-read") // CalDAV Proxy
val CALENDAR_PROXY_WRITE = Property.Name(XmlUtils.NS_CALENDARSERVER, "calendar-proxy-write") // CalDAV Proxy
val SUBSCRIBED = Property.Name(XmlUtils.NS_CALENDARSERVER, "subscribed")
}

Expand All @@ -42,11 +46,13 @@ class ResourceType: Property {
if (eventType == XmlPullParser.START_TAG && parser.depth == depth + 1) {
// use static objects to allow types.contains()
var typeName = Property.Name(parser.namespace, parser.name)
when (typeName) {
when (typeName) { // if equals(), replace by our instance
COLLECTION -> typeName = COLLECTION
PRINCIPAL -> typeName = PRINCIPAL
ADDRESSBOOK -> typeName = ADDRESSBOOK
CALENDAR -> typeName = CALENDAR
CALENDAR_PROXY_READ -> typeName = CALENDAR_PROXY_READ
CALENDAR_PROXY_WRITE -> typeName = CALENDAR_PROXY_WRITE
SUBSCRIBED -> typeName = SUBSCRIBED
}
type.types.add(typeName)
Expand Down

0 comments on commit 9cf4ef3

Please sign in to comment.