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:
parent
08abcc0514
commit
0a11da2b0f
|
@ -240,6 +240,25 @@ public class VCalendar extends VObject {
|
||||||
dtEnd.setParam("TZID", tzid);
|
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 {
|
} else {
|
||||||
// add organizer line to all events created in Exchange for active sync
|
// add organizer line to all events created in Exchange for active sync
|
||||||
String organizer = getEmailValue(vObject.getProperty("ORGANIZER"));
|
String organizer = getEmailValue(vObject.getProperty("ORGANIZER"));
|
||||||
|
|
Loading…
Reference in New Issue