From 8aac517cd218d8ee21534e72f3462c5a6aa87c4e Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 25 Feb 2021 10:53:10 -0600 Subject: [PATCH] Allow any share-access value --- app/src/main/java/org/tasks/caldav/property/ShareAccess.kt | 4 +--- app/src/main/java/org/tasks/caldav/property/Sharee.kt | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/tasks/caldav/property/ShareAccess.kt b/app/src/main/java/org/tasks/caldav/property/ShareAccess.kt index 06b267976..c5911eb01 100644 --- a/app/src/main/java/org/tasks/caldav/property/ShareAccess.kt +++ b/app/src/main/java/org/tasks/caldav/property/ShareAccess.kt @@ -34,9 +34,7 @@ data class ShareAccess(val access: Property.Name): Property { var eventType = parser.eventType while (!(eventType == XmlPullParser.END_TAG && parser.depth == depth)) { if (eventType == XmlPullParser.START_TAG && parser.depth == depth + 1) { - when (val name = parser.propertyName()) { - SHARED_OWNER, READ_WRITE, NOT_SHARED, READ -> result = name - } + result = parser.propertyName() } eventType = parser.next() } diff --git a/app/src/main/java/org/tasks/caldav/property/Sharee.kt b/app/src/main/java/org/tasks/caldav/property/Sharee.kt index 257da33e1..94d82e697 100644 --- a/app/src/main/java/org/tasks/caldav/property/Sharee.kt +++ b/app/src/main/java/org/tasks/caldav/property/Sharee.kt @@ -28,9 +28,10 @@ class Sharee(parser: XmlPullParser) { DavResource.HREF -> XmlUtils.readText(parser)?.let { href = it } ShareAccess.NAME -> - access = PropertyRegistry.create(ShareAccess.NAME, parser) as ShareAccess + PropertyRegistry.create(ShareAccess.NAME, parser) + ?.let { access = it as ShareAccess } COMMENT -> - comment = XmlUtils.readText(parser) + XmlUtils.readText(parser)?.let { comment = it } INVITE_ACCEPTED, INVITE_DECLINED, INVITE_NORESPONSE, INVITE_INVALID -> response = name DavResource.PROP ->