1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-03 05:34:51 +00:00

Allow sending invalid iCalendar files

This commit is contained in:
M66B 2024-10-10 22:03:16 +02:00
parent 3005bd008f
commit 54e26a1c9d

View file

@ -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;