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

Unverified Commit d7af678e authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Add MaxResourceSize for CalDAV/CardDAV

parent 5e502b42
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -44,6 +44,8 @@ object PropertyRegistry {
            GetETag.Factory,
            GetLastModified.Factory,
            GroupMembership.Factory,
            MaxICalendarSize.Factory,
            MaxVCardSize.Factory,
            Owner.Factory,
            QuotaAvailableBytes.Factory,
            QuotaUsedBytes.Factory,
+32 −0
Original line number Diff line number Diff line
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package at.bitfire.dav4jvm.property

import at.bitfire.dav4jvm.Property
import at.bitfire.dav4jvm.PropertyFactory
import at.bitfire.dav4jvm.XmlUtils
import org.xmlpull.v1.XmlPullParser

data class MaxICalendarSize(
        val maxSize: Long
) : Property {
    companion object {
        @JvmField
        val NAME = Property.Name(XmlUtils.NS_CALDAV, "max-resource-size")
    }

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

        override fun create(parser: XmlPullParser): MaxICalendarSize? {
            XmlUtils.readText(parser)?.let {
                return MaxICalendarSize(it.toLong())
            }
            return null
        }
    }
}
 No newline at end of file
+32 −0
Original line number Diff line number Diff line
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

package at.bitfire.dav4jvm.property

import at.bitfire.dav4jvm.Property
import at.bitfire.dav4jvm.PropertyFactory
import at.bitfire.dav4jvm.XmlUtils
import org.xmlpull.v1.XmlPullParser

data class MaxVCardSize(
        val maxSize: Long
) : Property {
    companion object {
        @JvmField
        val NAME = Property.Name(XmlUtils.NS_CARDDAV, "max-resource-size")
    }

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

        override fun create(parser: XmlPullParser): MaxVCardSize? {
            XmlUtils.readText(parser)?.let {
                return MaxVCardSize(it.toLong())
            }
            return null
        }
    }
}
 No newline at end of file