mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 22:14:40 +03:00
imapserver: implement PREVIEW extension (RFC 8970), and store previews in message database
We were already generating previews of plain text parts for the webmail interface, but we didn't store them, so were generating the previews each time messages were listed. Now we store previews in the database for faster handling. And we also generate previews for html parts if needed. We use the first part that has textual content. For IMAP, the previews can be requested by an IMAP client. When we get the "LAZY" variant, which doesn't require us to generate a preview, we generate it anyway, because it should be fast enough. So don't make clients first ask for "PREVIEW (LAZY)" and then again a request for "PREVIEW". We now also generate a preview when a message is added to the account. Except for imports. It would slow us down, the previews aren't urgent, and they will be generated on-demand at first-request.
This commit is contained in:
@ -2809,7 +2809,7 @@ const newMsgitemView = (mi: api.MessageItem, msglistView: MsglistView, otherMail
|
||||
css('msgItemSubjectText', {whiteSpace: 'nowrap', overflow: 'hidden'}),
|
||||
threadIndent > 0 ? dom.span(threadChar, style({paddingLeft: (threadIndent/2)+'em'}), css('msgItemThreadChar', {opacity: '.75', fontWeight: 'normal'}), threadCharTitle ? attr.title(threadCharTitle) : []) : [],
|
||||
msgitemView.parent ? [] : mi.Envelope.Subject || '(no subject)',
|
||||
dom.span(css('msgItemSubjectSnippet', {fontWeight: 'normal', color: styles.colorMilder}), ' '+mi.FirstLine),
|
||||
dom.span(css('msgItemSubjectSnippet', {fontWeight: 'normal', color: styles.colorMilder}), ' '+(mi.Message.Preview || '')),
|
||||
),
|
||||
dom.div(
|
||||
keywords,
|
||||
|
Reference in New Issue
Block a user