Do not break messages with long HTML content

This commit is contained in:
Andris Reinman 2022-12-15 15:56:31 +02:00
parent 6008fb26ed
commit 583e577b35
No known key found for this signature in database
GPG key ID: DC6C83F4D584D364
2 changed files with 3 additions and 3 deletions

View file

@ -34,7 +34,7 @@ module.exports = {
MAX_PLAINTEXT_CONTENT: 100 * 1024, MAX_PLAINTEXT_CONTENT: 100 * 1024,
// how much HTML content to store before truncating. not indexed // how much HTML content to store before truncating. not indexed
MAX_HTML_CONTENT: 300 * 1024, MAX_HTML_CONTENT: 640 * 1024,
MAX_AUTOREPLY_INTERVAL: 4 * 3600 * 1000, MAX_AUTOREPLY_INTERVAL: 4 * 3600 * 1000,

View file

@ -354,7 +354,7 @@ class MessageHandler {
return html; return html;
} }
html = html.substr(0, htmlSize + Buffer.byteLength(html) - consts.MAX_HTML_CONTENT); html = html.substr(0, consts.MAX_HTML_CONTENT);
htmlSize += Buffer.byteLength(html); htmlSize += Buffer.byteLength(html);
return html; return html;
}) })
@ -556,7 +556,7 @@ class MessageHandler {
modseq: messageData.modseq, modseq: messageData.modseq,
unseen: messageData.unseen, unseen: messageData.unseen,
idate: messageData.idate, idate: messageData.idate,
thread: messageData.thread, thread: messageData.thread
}, },
() => { () => {
this.notifier.fire(mailboxData.user); this.notifier.fire(mailboxData.user);