1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-10-31 15:35:05 -04:00

Carddav: Fix 3511472, implement fileas over EWS

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1944 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-04-16 22:25:07 +00:00
parent 0d7a1bba1d
commit 1f2b05506c
3 changed files with 9 additions and 2 deletions

View File

@ -1118,10 +1118,14 @@ public class EwsExchangeSession extends ExchangeSession {
for (Map.Entry<String, String> entry : entrySet()) { for (Map.Entry<String, String> entry : entrySet()) {
if ("photo".equals(entry.getKey())) { if ("photo".equals(entry.getKey())) {
updates.add(Field.createFieldUpdate("haspicture", "true")); updates.add(Field.createFieldUpdate("haspicture", "true"));
} else if (!entry.getKey().startsWith("email") && !entry.getKey().startsWith("smtpemail")) { } else if (!entry.getKey().startsWith("email") && !entry.getKey().startsWith("smtpemail")
&& !entry.getKey().equals("fileas")) {
updates.add(Field.createFieldUpdate(entry.getKey(), entry.getValue())); updates.add(Field.createFieldUpdate(entry.getKey(), entry.getValue()));
} }
} }
if (get("fileas") != null) {
updates.add(Field.createFieldUpdate("fileas", get("fileas")));
}
// handle email addresses // handle email addresses
IndexedFieldUpdate emailFieldUpdate = null; IndexedFieldUpdate emailFieldUpdate = null;
for (Map.Entry<String, String> entry : entrySet()) { for (Map.Entry<String, String> entry : entrySet()) {

View File

@ -93,7 +93,8 @@ public final class Field {
FIELD_MAP.put("subject", new ExtendedFieldURI(0x0037, ExtendedFieldURI.PropertyType.String)); FIELD_MAP.put("subject", new ExtendedFieldURI(0x0037, ExtendedFieldURI.PropertyType.String));
FIELD_MAP.put("middlename", new ExtendedFieldURI(0x3A44, ExtendedFieldURI.PropertyType.String)); FIELD_MAP.put("middlename", new ExtendedFieldURI(0x3A44, ExtendedFieldURI.PropertyType.String));
FIELD_MAP.put("fileas", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "urn:schemas:contacts:fileas")); //FIELD_MAP.put("fileas", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.PublicStrings, "urn:schemas:contacts:fileas"));
FIELD_MAP.put("fileas", new UnindexedFieldURI("contacts:FileAs"));
FIELD_MAP.put("homepostaladdress", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x801A, ExtendedFieldURI.PropertyType.String)); FIELD_MAP.put("homepostaladdress", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x801A, ExtendedFieldURI.PropertyType.String));
FIELD_MAP.put("otherpostaladdress", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x801C, ExtendedFieldURI.PropertyType.String)); FIELD_MAP.put("otherpostaladdress", new ExtendedFieldURI(ExtendedFieldURI.DistinguishedPropertySetType.Address, 0x801C, ExtendedFieldURI.PropertyType.String));

View File

@ -53,6 +53,8 @@ public class UnindexedFieldURI implements FieldURI {
itemType = "CalendarItem"; itemType = "CalendarItem";
} else if (fieldURI.startsWith("task") && itemType != null) { } else if (fieldURI.startsWith("task") && itemType != null) {
itemType = "Task"; itemType = "Task";
} else if (fieldURI.startsWith("contacts") && itemType != null) {
itemType = "Contact";
} }
if (itemType != null) { if (itemType != null) {
appendTo(buffer); appendTo(buffer);