Carddav: iPhone personalHomePage support

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1216 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-20 09:36:21 +00:00
parent e894e65da7
commit 173fa38526
2 changed files with 21 additions and 0 deletions

View File

@ -2728,6 +2728,9 @@ public abstract class ExchangeSession {
properties.put("businesshomepage", property.getValue());
} else if (property.hasParam("TYPE", "home")) {
properties.put("personalHomePage", property.getValue());
} else {
// default: set personal home page
properties.put("personalHomePage", property.getValue());
}
} else if ("TITLE".equals(property.getKey())) {
properties.put("title", property.getValue());
@ -3087,6 +3090,7 @@ public abstract class ExchangeSession {
CONTACT_ATTRIBUTES.add("extensionattribute4");
CONTACT_ATTRIBUTES.add("bday");
CONTACT_ATTRIBUTES.add("businesshomepage");
CONTACT_ATTRIBUTES.add("personalHomePage");
CONTACT_ATTRIBUTES.add("cn");
CONTACT_ATTRIBUTES.add("co");
CONTACT_ATTRIBUTES.add("department");

View File

@ -315,4 +315,21 @@ public class TestExchangeSessionContact extends AbstractExchangeSessionTestCase
assertEquals("mobile with prefix", contact.get("mobile"));
}
public void testIphonePersonalHomePage() throws IOException {
ExchangeSession.Contact contact = (ExchangeSession.Contact) session.getItem("testcontactfolder", itemName);
VCardWriter vCardWriter = new VCardWriter();
vCardWriter.startCard();
vCardWriter.appendProperty("ITEM1.URL", "http://www.myhomepage.org");
vCardWriter.endCard();
ExchangeSession.ItemResult result = session.createOrUpdateContact("testcontactfolder", itemName, vCardWriter.toString(), contact.etag, null);
assertEquals(200, result.status);
contact = (ExchangeSession.Contact) session.getItem("testcontactfolder", itemName);
assertEquals("http://www.myhomepage.org", contact.get("personalHomePage"));
}
}