Caldav: remove unsupported attachment reference to avoid iPhone/iPad crash

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1962 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-05-22 20:54:54 +00:00
parent 08abcc0514
commit 0a11da2b0f
1 changed files with 19 additions and 0 deletions

View File

@ -240,6 +240,25 @@ public class VCalendar extends VObject {
dtEnd.setParam("TZID", tzid);
}
}
// remove unsupported attachment reference
if (vObject.getProperty("ATTACH") != null) {
List<String> toRemoveValues = null;
List<String> values = vObject.getProperty("ATTACH").getValues();
for (String value : values) {
if (value.indexOf("CID:") >= 0) {
if (toRemoveValues == null) {
toRemoveValues = new ArrayList<String>();
}
toRemoveValues.add(value);
}
}
if (toRemoveValues != null) {
values.removeAll(toRemoveValues);
if (values.size() == 0) {
vObject.removeProperty("ATTACH");
}
}
}
} else {
// add organizer line to all events created in Exchange for active sync
String organizer = getEmailValue(vObject.getProperty("ORGANIZER"));