This commit is contained in:
Fathi Ben Nasr 2026-08-16 12:57:23 +01:00 committed by GitHub
commit 696254845c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,10 +86,17 @@
});
}
});
// ICS attachment
// let ics = msg.attachments.find(attachment => 'application/ics' == attachment.mimeType);
let ics = msg.attachments.find(attachment => 'text/calendar' == attachment.mimeType);
// ICS attachment.
// attachments is a ko.observableArray, so it must be
// unwrapped before array methods are used on it.
// A scheduling mail does not always carry a text/calendar
// attachment either: the part is often inline inside
// multipart/alternative and repeated as application/ics.
let ics = (msg.attachments() || []).find(attachment =>
'text/calendar' == attachment.mimeType
|| 'application/ics' == attachment.mimeType
|| 'text/x-vcalendar' == attachment.mimeType
|| /\.ics$/i.test(attachment.fileName || ''));
if (ics && ics.download) {
// fetch it and parse the VEVENT