Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c813b0b2 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Support caldav:supported.calendar-data

- also change factories to objects (minor change)
parent 4d9f27bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ group="com.gitlab.bitfireAT"
version="2.1.3"

plugins {
    kotlin("jvm") version "1.5.30"
    kotlin("jvm") version "1.5.31"
    `maven-publish`

    id("org.jetbrains.dokka") version "1.5.0"
+2 −2
Original line number Diff line number Diff line
@@ -85,9 +85,9 @@ class DavAddressBook @JvmOverloads constructor(
     *
     * @param urls         list of vCard URLs to be requested
     * @param contentType  MIME type of requested format; may be "text/vcard" for vCard or
     *                     "application/vcard+json" for jCard
     *                     "application/vcard+json" for jCard. *null*: don't request specific representation type
     * @param version      vCard version subtype of the requested format. Should only be specified together with a [contentType] of "text/vcard".
     *                     Currently only useful value: "4.0" for vCard 4.
     *                     Currently only useful value: "4.0" for vCard 4. *null*: don't request specific version
     * @param callback     called for every WebDAV response XML element in the result
     *
     * @return list of properties which have been received in the Multi-Status response, but
+12 −4
Original line number Diff line number Diff line
@@ -123,6 +123,9 @@ class DavCalendar @JvmOverloads constructor(
     * to the callback, whether they are successful (2xx) or not.
     *
     * @param urls         list of iCalendar URLs to be requested
     * @param contentType  MIME type of requested format; may be "text/calendar" for iCalendar or
     *                     "application/calendar+json" for jCard. *null*: don't request specific representation type
     * @param version      Version subtype of the requested format, like "2.0" for iCalendar 2. *null*: don't request specific version
     * @param callback     called for every WebDAV response XML element in the result
     *
     * @return list of properties which have been received in the Multi-Status response, but
@@ -132,7 +135,7 @@ class DavCalendar @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error
     */
    fun multiget(urls: List<HttpUrl>, callback: DavResponseCallback): List<Property> {
    fun multiget(urls: List<HttpUrl>, contentType: String? = null, version: String? = null, callback: DavResponseCallback): List<Property> {
        /* <!ELEMENT calendar-multiget ((DAV:allprop |
                                        DAV:propname |
                                        DAV:prop)?, DAV:href+)>
@@ -148,7 +151,12 @@ class DavCalendar @JvmOverloads constructor(
                insertTag(GetContentType.NAME)     // to determine the character set
                insertTag(GetETag.NAME)
                insertTag(ScheduleTag.NAME)
                insertTag(CalendarData.NAME)
                insertTag(CalendarData.NAME) {
                    if (contentType != null)
                        attribute(null, CalendarData.CONTENT_TYPE, contentType)
                    if (version != null)
                        attribute(null, CalendarData.VERSION, version)
                }
            }
            for (url in urls)
                insertTag(HREF) {
+33 −32
Original line number Diff line number Diff line
@@ -22,38 +22,39 @@ object PropertyRegistry {

    private fun registerDefaultFactories() {
        register(listOf(
            AddMember.Factory(),
            AddressbookDescription.Factory(),
            AddressbookHomeSet.Factory(),
            AddressData.Factory(),
            CalendarColor.Factory(),
            CalendarData.Factory(),
            CalendarDescription.Factory(),
            CalendarHomeSet.Factory(),
            CalendarProxyReadFor.Factory(),
            CalendarProxyWriteFor.Factory(),
            CalendarTimezone.Factory(),
            CalendarUserAddressSet.Factory(),
            CreationDate.Factory(),
            CurrentUserPrincipal.Factory(),
            CurrentUserPrivilegeSet.Factory(),
            DisplayName.Factory(),
            GetContentLength.Factory(),
            GetContentType.Factory(),
            GetCTag.Factory(),
            GetETag.Factory(),
            GetLastModified.Factory(),
            GroupMembership.Factory(),
            Owner.Factory(),
            QuotaAvailableBytes.Factory(),
            QuotaUsedBytes.Factory(),
            ResourceType.Factory(),
            ScheduleTag.Factory(),
            Source.Factory(),
            SupportedAddressData.Factory(),
            SupportedCalendarComponentSet.Factory(),
            SupportedReportSet.Factory(),
            SyncToken.Factory()
            AddMember.Factory,
            AddressbookDescription.Factory,
            AddressbookHomeSet.Factory,
            AddressData.Factory,
            CalendarColor.Factory,
            CalendarData.Factory,
            CalendarDescription.Factory,
            CalendarHomeSet.Factory,
            CalendarProxyReadFor.Factory,
            CalendarProxyWriteFor.Factory,
            CalendarTimezone.Factory,
            CalendarUserAddressSet.Factory,
            CreationDate.Factory,
            CurrentUserPrincipal.Factory,
            CurrentUserPrivilegeSet.Factory,
            DisplayName.Factory,
            GetContentLength.Factory,
            GetContentType.Factory,
            GetCTag.Factory,
            GetETag.Factory,
            GetLastModified.Factory,
            GroupMembership.Factory,
            Owner.Factory,
            QuotaAvailableBytes.Factory,
            QuotaUsedBytes.Factory,
            ResourceType.Factory,
            ScheduleTag.Factory,
            Source.Factory,
            SupportedAddressData.Factory,
            SupportedCalendarComponentSet.Factory,
            SupportedCalendarData.Factory,
            SupportedReportSet.Factory,
            SyncToken.Factory
        ))
    }

+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ data class AddMember(
        val NAME = Property.Name(XmlUtils.NS_WEBDAV, "add-member")
    }

    class Factory: PropertyFactory {
    object Factory: PropertyFactory {
        override fun getName() = NAME

        override fun create(parser: XmlPullParser) =
Loading