From ebf429215b7c371e60bd9e26ce4be04a23c4b15c Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 13 Feb 2023 19:46:30 +0100 Subject: [PATCH] view Message in new tab/window was missing BCC --- dev/Model/Message.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/Model/Message.js b/dev/Model/Message.js index a55b9cdb5..97d5b044f 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -335,18 +335,21 @@ export class MessageModel extends AbstractModel { viewPopupMessage(print) { const timeStampInUTC = this.dateTimeStampInUTC() || 0, ccLine = this.cc.toString(), + bccLine = this.bcc.toString(), m = 0 < timeStampInUTC ? new Date(timeStampInUTC * 1000) : null, win = open(''), - sdoc = win.document; - let subject = encodeHtml(this.subject()), + sdoc = win.document, + subject = encodeHtml(this.subject()), mode = this.isHtml() ? 'div' : 'pre', - cc = ccLine ? `
${encodeHtml(i18n('GLOBAL/CC'))}: ${encodeHtml(ccLine)}
` : '', + to = `
${encodeHtml(i18n('GLOBAL/TO'))}: ${encodeHtml(this.to)}
` + + (ccLine ? `
${encodeHtml(i18n('GLOBAL/CC'))}: ${encodeHtml(ccLine)}
` : '') + + (bccLine ? `
${encodeHtml(i18n('GLOBAL/BCC'))}: ${encodeHtml(bccLine)}
` : ''), style = getComputedStyle(doc.querySelector('.messageView')), prop = property => style.getPropertyValue(property); sdoc.write(PreviewHTML .replace('', '<title>'+subject) // eslint-disable-next-line max-len - .replace('<body>', `<body style="background-color:${prop('background-color')};color:${prop('color')}"><header><h1>${subject}</h1><time>${encodeHtml(m ? m.format('LLL',0,LanguageStore.hourCycle()) : '')}</time><div>${encodeHtml(this.from)}</div><div>${encodeHtml(i18n('GLOBAL/TO'))}: ${encodeHtml(this.to)}</div>${cc}</header><${mode}>${this.bodyAsHTML()}</${mode}>`) + .replace('<body>', `<body style="background-color:${prop('background-color')};color:${prop('color')}"><header><h1>${subject}</h1><time>${encodeHtml(m ? m.format('LLL',0,LanguageStore.hourCycle()) : '')}</time><div>${encodeHtml(this.from)}</div>${to}</header><${mode}>${this.bodyAsHTML()}</${mode}>`) ); sdoc.close();