Allow sending invalid iCalendar files

pull/217/head
M66B 12 months ago
parent 3005bd008f
commit 54e26a1c9d

@ -1382,19 +1382,22 @@ public class MessageHelper {
for (EntityAttachment attachment : attachments) for (EntityAttachment attachment : attachments)
if (attachment.available && if (attachment.available &&
"text/calendar".equals(attachment.type)) { "text/calendar".equals(attachment.type))
File file = attachment.getFile(context); try {
ICalendar icalendar = CalendarHelper.parse(context, file); File file = attachment.getFile(context);
Method method = (icalendar == null ? null : icalendar.getMethod()); ICalendar icalendar = CalendarHelper.parse(context, file);
if (method != null && method.isReply()) { Method method = (icalendar == null ? null : icalendar.getMethod());
// https://www.rfc-editor.org/rfc/rfc6047#section-2.4 if (method != null && method.isReply()) {
BodyPart calPart = new MimeBodyPart(); // https://www.rfc-editor.org/rfc/rfc6047#section-2.4
calPart.setContent(icalendar.write(), attachment.type + ";" + BodyPart calPart = new MimeBodyPart();
" method=" + method.getValue() + ";" + calPart.setContent(icalendar.write(), attachment.type + ";" +
" charset=UTF-8;"); " method=" + method.getValue() + ";" +
altMultiPart.addBodyPart(calPart); " charset=UTF-8;");
altMultiPart.addBodyPart(calPart);
}
} catch (Throwable ex) {
Log.w(ex);
} }
}
int availableAttachments = 0; int availableAttachments = 0;
boolean hasInline = false; boolean hasInline = false;

Loading…
Cancel
Save