1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 03:02:22 -05:00

Carddav: Fix regression in single value multiline properties

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1242 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-21 09:20:22 +00:00
parent 3f3e51298b
commit 84a05c6bdd
2 changed files with 15 additions and 2 deletions

View File

@ -2788,7 +2788,7 @@ public abstract class ExchangeSession {
properties.put("im", property.getValue());
} else if ("BDAY".equals(property.getKey())) {
properties.put("bday", convertBDayToZulu(property.getValue()));
} else if ("ANNIVERSARY".equals(property.getKey())) {
} else if ("ANNIVERSARY".equals(property.getKey()) || "X-ANNIVERSARY".equals(property.getKey())) {
properties.put("anniversary", convertBDayToZulu(property.getValue()));
} else if ("CATEGORIES".equals(property.getKey())) {
properties.put("keywords", property.getValue());

View File

@ -31,11 +31,24 @@ public class VCardWriter extends ICSBufferedWriter {
if ((propertyValue != null) && (propertyValue.length() > 0)) {
write(propertyName);
write(":");
writeLine(propertyValue);
writeLine(encodeMultiline(propertyValue));
}
}
protected String encodeMultiline(String value) {
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
if (c == '\n') {
buffer.append("\\n");
} else {
buffer.append(value.charAt(i));
}
}
return buffer.toString();
}
public void appendProperty(String propertyName, String... propertyValue) {
boolean hasValue = false;
for (String value : propertyValue) {