diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index a007a26a..228f7150 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1733,7 +1733,14 @@ public abstract class ExchangeSession { writer.appendProperty("X-AIM", get("im")); writer.appendProperty("BDAY", convertZuluDateToBday(get("bday"))); - writer.appendProperty("X-ANNIVERSARY", convertZuluDateToBday(get("anniversary"))); + writer.appendProperty("ANNIVERSARY", convertZuluDateToBday(get("anniversary"))); + + String gender = get("gender"); + if ("1".equals(gender)) { + writer.appendProperty("SEX", "2"); + } else if ("2".equals(gender)) { + writer.appendProperty("SEX", "1"); + } writer.appendProperty("CATEGORIES", get("keywords")); @@ -2781,8 +2788,8 @@ public abstract class ExchangeSession { properties.put("im", property.getValue()); } else if ("BDAY".equals(property.getKey())) { properties.put("bday", convertBDayToZulu(property.getValue())); - } else if ("X-ANNIVERSARY".equals(property.getKey())) { - properties.put("anniversary", convertBDayToZulu(property.getValue())); + } else if ("ANNIVERSARY".equals(property.getKey())) { + properties.put("anniversary", convertBDayToZulu(property.getValue())); } else if ("CATEGORIES".equals(property.getKey())) { properties.put("keywords", property.getValue()); } else if ("CLASS".equals(property.getKey())) { @@ -2793,6 +2800,13 @@ public abstract class ExchangeSession { properties.put("sensitivity", "2"); properties.put("private", "true"); } + } else if ("SEX".equals(property.getKey())) { + String propertyValue = property.getValue(); + if ("1".equals(propertyValue)) { + properties.put("gender", "2"); + } else if ("2".equals(propertyValue)) { + properties.put("gender", "1"); + } } else if ("X-ASSISTANT".equals(property.getKey())) { properties.put("secretarycn", property.getValue()); } else if ("X-MANAGER".equals(property.getKey())) { @@ -2834,7 +2848,7 @@ public abstract class ExchangeSession { LOGGER.warn("Invalid date: " + value); } } - + return result; } @@ -3187,7 +3201,7 @@ public abstract class ExchangeSession { CONTACT_ATTRIBUTES.add("haspicture"); CONTACT_ATTRIBUTES.add("keywords"); CONTACT_ATTRIBUTES.add("othermobile"); - + CONTACT_ATTRIBUTES.add("gender"); CONTACT_ATTRIBUTES.add("private"); CONTACT_ATTRIBUTES.add("sensitivity"); } diff --git a/src/java/davmail/exchange/dav/Field.java b/src/java/davmail/exchange/dav/Field.java index 788b24a1..86447fc2 100644 --- a/src/java/davmail/exchange/dav/Field.java +++ b/src/java/davmail/exchange/dav/Field.java @@ -249,6 +249,8 @@ public class Field { createField(URN_SCHEMAS_CONTACTS, "othercountry"); // PR_OTHER_ADDRESS_COUNTRY 0x3A60 String createField(URN_SCHEMAS_CONTACTS, "othercity"); // PR_OTHER_ADDRESS_CITY 0x3A5F String + createField(URN_SCHEMAS_CONTACTS, "gender"); // PR_GENDER 0x3A4D Integer16 + createField("keywords", SCHEMAS_EXCHANGE, "keywords-utf8", PropertyType.StringArray); // PS_PUBLIC_STRINGS Keywords String //createField("keywords", DistinguishedPropertySetType.PublicStrings, "Keywords", ); // PS_PUBLIC_STRINGS Keywords String diff --git a/src/java/davmail/exchange/ews/Field.java b/src/java/davmail/exchange/ews/Field.java index 0cce0bbf..dbed37ff 100644 --- a/src/java/davmail/exchange/ews/Field.java +++ b/src/java/davmail/exchange/ews/Field.java @@ -141,6 +141,8 @@ public class Field { FIELD_MAP.put("othercountry", new ExtendedFieldURI(0x3A60, ExtendedFieldURI.PropertyType.String)); FIELD_MAP.put("othercity", new ExtendedFieldURI(0x3A5F, ExtendedFieldURI.PropertyType.String)); + FIELD_MAP.put("gender", new ExtendedFieldURI(0x3A4D, ExtendedFieldURI.PropertyType.Short)); + FIELD_MAP.put("keywords", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "Keywords", ExtendedFieldURI.PropertyType.StringArray)); FIELD_MAP.put("private", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Common, 0x8506, ExtendedFieldURI.PropertyType.Boolean));