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

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

Update ez-vcard (upstream fix of #20)

parent 4408cdd0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ dependencies {
    implementation("org.apache.commons:commons-text:1.3")

    // ez-vcard to parse/generate vCards
    api("com.googlecode.ez-vcard:ez-vcard:0.12.0") {    // requires Java 8
    api("com.googlecode.ez-vcard:ez-vcard:0.12.1") {    // requires Java 8
        // hCard functionality not needed
        exclude(group = "org.jsoup")
        exclude(group = "org.freemarker")
+3 −6
Original line number Diff line number Diff line
@@ -125,13 +125,10 @@ class ContactReader internal constructor(val vCard: VCard, val downloader: Conta
                is Uid ->
                    c.uid = uriToUid(prop.value)

                is Kind -> {        // includes XAddressBookServerKind
                    // c.group = prop.isGroup    // https://github.com/mangstadt/ez-vcard/issues/140
                    c.group = prop.value.equals(Kind.GROUP, true)
                }
                is Member -> {      // includes XAddressBookServerMember
                is Kind ->      // includes XAddressBookServerKind
                    c.group = prop.isGroup
                is Member ->    // includes XAddressBookServerMember
                    uriToUid(prop.uri)?.let { c.members += it }
                }

                is FormattedName ->
                    c.displayName = StringUtils.trimToNull(prop.value)
+2 −2
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ class ContactWriterTest {

        val stream = ByteArrayOutputStream()
        generator.writeCard(stream, true)
        assertEquals("[\"vcard\",[[\"version\",{},\"text\",\"4.0\"],[\"prodid\",{},\"text\",\"ez-vcard 0.12.0\"],[\"fn\",{},\"text\",\"\"],[\"rev\",{},\"timestamp\",\"2021-07-30T01:02:03+00:00\"]]]", stream.toString())
        assertEquals("[\"vcard\",[[\"version\",{},\"text\",\"4.0\"],[\"prodid\",{},\"text\",\"ez-vcard 0.12.1\"],[\"fn\",{},\"text\",\"\"],[\"rev\",{},\"timestamp\",\"2021-07-30T01:02:03+00:00\"]]]", stream.toString())
    }


@@ -576,7 +576,7 @@ class ContactWriterTest {
        generator.writeCard(stream, false)
        assertEquals("BEGIN:VCARD\r\n" +
                "VERSION:4.0\r\n" +
                "PRODID:ez-vcard 0.12.0\r\n" +
                "PRODID:ez-vcard 0.12.1\r\n" +
                "FN:\r\n" +
                "REV:20210730T010203+0000\r\n" +
                "END:VCARD\r\n", stream.toString())
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ import org.junit.Test
class EzVCardTest {

    // https://github.com/mangstadt/ez-vcard/issues/140
    @Test(expected = AssertionError::class)
    @Test()
    fun testKind_GROUP_uppercase() {
        val vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
                "VERSION:4.0\r\n" +