From 3d460c64c0498b11c7d7418aedde9a5313600c71 Mon Sep 17 00:00:00 2001 From: mguessan Date: Mon, 26 Jul 2010 13:22:28 +0000 Subject: [PATCH] Carddav: add fburl field git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1278 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 5 +++++ src/java/davmail/exchange/dav/Field.java | 2 ++ src/java/davmail/exchange/ews/Field.java | 2 ++ src/test/davmail/exchange/TestExchangeSessionContact.java | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index aae77408..8b1288ec 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1761,6 +1761,8 @@ public abstract class ExchangeSession { writer.appendProperty("CATEGORIES", get("keywords")); + writer.appendProperty("FBURL", get("fburl")); + if ("1".equals(get("private"))) { writer.appendProperty("CLASS", "PRIVATE"); } @@ -2862,6 +2864,8 @@ public abstract class ExchangeSession { } else if ("2".equals(propertyValue)) { properties.put("gender", "1"); } + } else if ("FBURL".equals(property.getKey())) { + properties.put("fburl", property.getValue()); } else if ("X-ASSISTANT".equals(property.getKey())) { properties.put("secretarycn", property.getValue()); } else if ("X-MANAGER".equals(property.getKey())) { @@ -3259,6 +3263,7 @@ public abstract class ExchangeSession { CONTACT_ATTRIBUTES.add("gender"); CONTACT_ATTRIBUTES.add("private"); CONTACT_ATTRIBUTES.add("sensitivity"); + CONTACT_ATTRIBUTES.add("fburl"); } /** diff --git a/src/java/davmail/exchange/dav/Field.java b/src/java/davmail/exchange/dav/Field.java index a8ce019e..294f8e52 100644 --- a/src/java/davmail/exchange/dav/Field.java +++ b/src/java/davmail/exchange/dav/Field.java @@ -259,6 +259,8 @@ public class Field { createField("haspicture", DistinguishedPropertySetType.Address, 0x8015, "haspicture", PropertyType.Boolean); // True/False + createField(URN_SCHEMAS_CALENDAR, "fburl"); // freeBusyLocation + // OWA settings createField("messageclass", 0x001a, PropertyType.String); createField("roamingxmlstream", 0x7c08, PropertyType.Binary); diff --git a/src/java/davmail/exchange/ews/Field.java b/src/java/davmail/exchange/ews/Field.java index 1a7ec744..1e04594b 100644 --- a/src/java/davmail/exchange/ews/Field.java +++ b/src/java/davmail/exchange/ews/Field.java @@ -161,6 +161,8 @@ public class Field { FIELD_MAP.put("haspicture", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x8015, ExtendedFieldURI.PropertyType.Boolean)); + FIELD_MAP.put("fburl", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x80D8, ExtendedFieldURI.PropertyType.String)); + // calendar FIELD_MAP.put("processed", new ExtendedFieldURI(0x65e8, ExtendedFieldURI.PropertyType.Boolean)); diff --git a/src/test/davmail/exchange/TestExchangeSessionContact.java b/src/test/davmail/exchange/TestExchangeSessionContact.java index 254cbc89..ed38edda 100644 --- a/src/test/davmail/exchange/TestExchangeSessionContact.java +++ b/src/test/davmail/exchange/TestExchangeSessionContact.java @@ -89,6 +89,8 @@ public class TestExchangeSessionContact extends AbstractExchangeSessionTestCase vCardWriter.appendProperty("BDAY", "2000-01-02T00:00:00Z"); vCardWriter.appendProperty("CATEGORIES", "keyword1,keyword2"); + vCardWriter.appendProperty("FBURL", "http://fburl"); + vCardWriter.appendProperty("X-ASSISTANT", "secretarycn"); vCardWriter.appendProperty("X-MANAGER", "manager"); vCardWriter.appendProperty("X-SPOUSE", "spousecn"); @@ -174,6 +176,8 @@ public class TestExchangeSessionContact extends AbstractExchangeSessionTestCase assertEquals("true", contact.get("private")); + assertEquals("http://fburl", contact.get("url")); + assertEquals("true", contact.get("haspicture")); assertNotNull(session.getContactPhoto(contact)); }