Merge remote-tracking branch 'github.com/mattfbacon/mox/message-is-text'

This commit is contained in:
Mechiel Lukkien 2023-11-02 14:41:43 +01:00
commit 38694d3928
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -2919,7 +2919,7 @@ const newMsgView = (miv, msglistView, listMailboxes, possibleLabels, messageLoad
'image/apng', 'image/apng',
'image/svg+xml', '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 isImage = (a) => imageTypes.includes((a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase());
const isPDF = (a) => (a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase() === 'application/pdf'; const isPDF = (a) => (a.Part.MediaType + '/' + a.Part.MediaSubType).toLowerCase() === 'application/pdf';
const isViewable = (a) => isText(a) || isImage(a) || isPDF(a); const isViewable = (a) => isText(a) || isImage(a) || isPDF(a);

View file

@ -2466,7 +2466,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
'image/apng', 'image/apng',
'image/svg+xml', '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 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 isPDF = (a: api.Attachment) => (a.Part.MediaType+'/'+a.Part.MediaSubType).toLowerCase() === 'application/pdf'
const isViewable = (a: api.Attachment) => isText(a) || isImage(a) || isPDF(a) const isViewable = (a: api.Attachment) => isText(a) || isImage(a) || isPDF(a)