mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 19:22:22 -05:00
Carddav: adjust fields accepting multiple values
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1229 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
7064d5a690
commit
344216989f
@ -106,7 +106,13 @@ public class VCardReader extends ICSBufferedReader {
|
||||
}
|
||||
}
|
||||
// iPhone encodes category separator
|
||||
if (c == ',' && !"NOTE".equals(key)) {
|
||||
if (c == ',' &&
|
||||
// multivalued properties
|
||||
("N".equals(key) ||
|
||||
"ADR".equals(key) ||
|
||||
"CATEGORIES".equals(key) ||
|
||||
"NICKNAME".equals(key)
|
||||
)) {
|
||||
// convert multiple values to multiline values (e.g. street)
|
||||
c = '\n';
|
||||
}
|
||||
|
@ -372,4 +372,21 @@ public class TestExchangeSessionContact extends AbstractExchangeSessionTestCase
|
||||
ExchangeSession.ItemResult result = session.createOrUpdateContact("testcontactfolder", itemName, itemBody, contact.etag, null);
|
||||
assertEquals(200, result.status);
|
||||
}
|
||||
|
||||
public void testIphoneEncodedComma() throws IOException {
|
||||
ExchangeSession.Contact contact = getCurrentContact();
|
||||
|
||||
VCardWriter vCardWriter = new VCardWriter();
|
||||
vCardWriter.startCard();
|
||||
vCardWriter.appendProperty("ITEM1.TEL;TYPE=CELL;TYPE=pref", "mobile\\, with comma");
|
||||
vCardWriter.endCard();
|
||||
|
||||
ExchangeSession.ItemResult result = session.createOrUpdateContact("testcontactfolder", itemName, vCardWriter.toString(), contact.etag, null);
|
||||
assertEquals(200, result.status);
|
||||
|
||||
contact = getCurrentContact();
|
||||
|
||||
assertEquals("mobile, with comma", contact.get("mobile"));
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user