mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12: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:
parent
3f3e51298b
commit
84a05c6bdd
@ -2788,7 +2788,7 @@ public abstract class ExchangeSession {
|
|||||||
properties.put("im", property.getValue());
|
properties.put("im", property.getValue());
|
||||||
} else if ("BDAY".equals(property.getKey())) {
|
} else if ("BDAY".equals(property.getKey())) {
|
||||||
properties.put("bday", convertBDayToZulu(property.getValue()));
|
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()));
|
properties.put("anniversary", convertBDayToZulu(property.getValue()));
|
||||||
} else if ("CATEGORIES".equals(property.getKey())) {
|
} else if ("CATEGORIES".equals(property.getKey())) {
|
||||||
properties.put("keywords", property.getValue());
|
properties.put("keywords", property.getValue());
|
||||||
|
@ -31,11 +31,24 @@ public class VCardWriter extends ICSBufferedWriter {
|
|||||||
if ((propertyValue != null) && (propertyValue.length() > 0)) {
|
if ((propertyValue != null) && (propertyValue.length() > 0)) {
|
||||||
write(propertyName);
|
write(propertyName);
|
||||||
write(":");
|
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) {
|
public void appendProperty(String propertyName, String... propertyValue) {
|
||||||
boolean hasValue = false;
|
boolean hasValue = false;
|
||||||
for (String value : propertyValue) {
|
for (String value : propertyValue) {
|
||||||
|
Loading…
Reference in New Issue
Block a user