From 3b6e1851cb61c5773510628004e73d6b65adafae Mon Sep 17 00:00:00 2001 From: Matt Fellenz Date: Wed, 1 Nov 2023 14:17:02 -0700 Subject: [PATCH] Treat messages as text --- webmail/webmail.js | 2 +- webmail/webmail.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webmail/webmail.js b/webmail/webmail.js index 44e862c..751898d 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -2915,7 +2915,7 @@ const newMsgView = (miv, msglistView, listMailboxes, possibleLabels, messageLoad 'image/apng', 'image/svg+xml', ]; - const isText = (a) => a.Part.MediaType.toLowerCase() === 'text'; + const isText = (a) => ['text', 'message'].includes(a.Part.MediaType.toLowerCase()); const isImage = (a) => imageTypes.includes((a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase()); const isPDF = (a) => (a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase() === 'application/pdf'; const isViewable = (a) => isText(a) || isImage(a) || isPDF(a); diff --git a/webmail/webmail.ts b/webmail/webmail.ts index c621053..395ec4c 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -2463,7 +2463,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l 'image/apng', 'image/svg+xml', ] - const isText = (a: api.Attachment) => a.Part.MediaType.toLowerCase() === 'text' + const isText = (a: api.Attachment) => ['text', 'message'].includes(a.Part.MediaType.toLowerCase()) const isImage = (a: api.Attachment) => imageTypes.includes((a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase()) const isPDF = (a: api.Attachment) => (a.Part.MediaType+'/'+a.Part.MediaSubType).toLowerCase() === 'application/pdf' const isViewable = (a: api.Attachment) => isText(a) || isImage(a) || isPDF(a)