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

Loading…
Cancel
Save