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

Commit a81962a3 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Merge branch 'upstream/master' into 1292-Update_with_upstream

parents d2761231 da94a8ba
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -104,12 +104,7 @@ class DavAddressBook @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error
     */
    fun multiget(
        urls: List<HttpUrl>,
        contentType: String? = null,
        version: String? = null,
        callback: MultiResponseCallback
    ): List<Property> {
    fun multiget(urls: List<HttpUrl>, contentType: String? = null, version: String? = null, callback: MultiResponseCallback): List<Property> {
        /* <!ELEMENT addressbook-multiget ((DAV:allprop |
                                            DAV:propname |
                                            DAV:prop)?,
+8 −22
Original line number Diff line number Diff line
@@ -67,12 +67,7 @@ class DavCalendar @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error
     */
    fun calendarQuery(
        component: String,
        start: Instant?,
        end: Instant?,
        callback: MultiResponseCallback
    ): List<Property> {
    fun calendarQuery(component: String, start: Instant?, end: Instant?, callback: MultiResponseCallback): List<Property> {
        /* <!ELEMENT calendar-query ((DAV:allprop |
                                      DAV:propname |
                                      DAV:prop)?, filter, timezone?)>
@@ -102,17 +97,13 @@ class DavCalendar @JvmOverloads constructor(
                        if (start != null || end != null) {
                            insertTag(TIME_RANGE) {
                                if (start != null)
                                    attribute(
                                        null, TIME_RANGE_START, timeFormatUTC.format(
                                    attribute(null, TIME_RANGE_START, timeFormatUTC.format(
                                        ZonedDateTime.ofInstant(start, ZoneOffset.UTC)
                                        )
                                    )
                                    ))
                                if (end != null)
                                    attribute(
                                        null, TIME_RANGE_END, timeFormatUTC.format(
                                    attribute(null, TIME_RANGE_END, timeFormatUTC.format(
                                        ZonedDateTime.ofInstant(end, ZoneOffset.UTC)
                                        )
                                    )
                                    ))
                            }
                        }
                    }
@@ -155,12 +146,7 @@ class DavCalendar @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error
     */
    fun multiget(
        urls: List<HttpUrl>,
        contentType: String? = null,
        version: String? = null,
        callback: MultiResponseCallback
    ): List<Property> {
    fun multiget(urls: List<HttpUrl>, contentType: String? = null, version: String? = null, callback: MultiResponseCallback): List<Property> {
        /* <!ELEMENT calendar-multiget ((DAV:allprop |
                                        DAV:propname |
                                        DAV:prop)?, DAV:href+)>
+1 −7
Original line number Diff line number Diff line
@@ -77,13 +77,7 @@ open class DavCollection @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error
     */
    fun reportChanges(
        syncToken: String?,
        infiniteDepth: Boolean,
        limit: Int?,
        vararg properties: Property.Name,
        callback: MultiResponseCallback
    ): List<Property> {
    fun reportChanges(syncToken: String?, infiniteDepth: Boolean, limit: Int?, vararg properties: Property.Name, callback: MultiResponseCallback): List<Property> {
        /* <!ELEMENT sync-collection (sync-token, sync-level, limit?, prop)>

           <!ELEMENT sync-token CDATA>       <!-- Text MUST be a URI -->
+5 −24
Original line number Diff line number Diff line
@@ -384,13 +384,7 @@ open class DavResource @JvmOverloads constructor(
     * @throws DavException on high-level errors
     */
    @Throws(IOException::class, HttpException::class)
    fun getRange(
        accept: String,
        offset: Long,
        size: Int,
        headers: Headers? = null,
        callback: ResponseCallback
    ) {
    fun getRange(accept: String, offset: Long, size: Int, headers: Headers? = null, callback: ResponseCallback) {
        followRedirects {
            val request = Request.Builder()
                .get()
@@ -431,13 +425,7 @@ open class DavResource @JvmOverloads constructor(
     * @throws DavException on HTTPS -> HTTP redirect
     */
    @Throws(IOException::class, HttpException::class)
    fun put(
        body: RequestBody,
        ifETag: String? = null,
        ifScheduleTag: String? = null,
        ifNoneMatch: Boolean = false,
        callback: ResponseCallback
    ) {
    fun put(body: RequestBody, ifETag: String? = null, ifScheduleTag: String? = null, ifNoneMatch: Boolean = false, callback: ResponseCallback) {
        followRedirects {
            val builder = Request.Builder()
                .put(body)
@@ -633,7 +621,6 @@ open class DavResource @JvmOverloads constructor(
        }
    }


    // status handling

    /**
@@ -775,10 +762,7 @@ open class DavResource @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error (for instance, when the response is not a Multi-Status response)
     */
    protected fun processMultiStatus(
        response: Response,
        callback: MultiResponseCallback
    ): List<Property> {
    protected fun processMultiStatus(response: Response, callback: MultiResponseCallback): List<Property> {
        checkStatus(response)
        assertMultiStatus(response)
        response.body!!.use {
@@ -799,10 +783,7 @@ open class DavResource @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on WebDAV error (like an invalid XML response)
     */
    protected fun processMultiStatus(
        reader: Reader,
        callback: MultiResponseCallback
    ): List<Property> {
    protected fun processMultiStatus(reader: Reader, callback: MultiResponseCallback): List<Property> {
        val responseProperties = mutableListOf<Property>()
        val parser = XmlUtils.newPullParser()