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

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

SupportedCalendarComponentSet: detect VJOURNAL support

parent 7dee8547
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -13,7 +13,8 @@ import org.xmlpull.v1.XmlPullParser

data class SupportedCalendarComponentSet(
        var supportsEvents: Boolean,
        var supportsTasks: Boolean
        var supportsTasks: Boolean,
        var supportsJournal: Boolean
): Property {

    companion object {
@@ -31,7 +32,7 @@ data class SupportedCalendarComponentSet(
               <!ELEMENT comp ((allprop | prop*), (allcomp | comp*))>
               <!ATTLIST comp name CDATA #REQUIRED>
            */
            val components = SupportedCalendarComponentSet(false, false)
            val components = SupportedCalendarComponentSet(false, false, false)

            val depth = parser.depth
            var eventType = parser.eventType
@@ -41,11 +42,13 @@ data class SupportedCalendarComponentSet(
                        "allcomp" -> {
                            components.supportsEvents = true
                            components.supportsTasks = true
                            components.supportsJournal = true
                        }
                        "comp" ->
                            when (parser.getAttributeValue(null, "name")?.toUpperCase()) {
                                "VEVENT" -> components.supportsEvents = true
                                "VTODO" -> components.supportsTasks = true
                                "VJOURNAL" -> components.supportsJournal = true
                            }
                    }
                }