diff --git a/dev/Model/Message.js b/dev/Model/Message.js index b8858cdb7..455a0bf34 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -614,7 +614,8 @@ export class MessageModel extends AbstractModel { * @returns {string} */ bodyAsHTML() { - if (this.body) { +// if (this.body && !this.body.querySelector('iframe[src*=decrypt]')) { + if (this.body && !this.body.querySelector('iframe')) { let clone = this.body.cloneNode(true), attr = 'data-html-editor-font-wrapper'; clone.querySelectorAll('blockquote.rl-bq-switcher').forEach( @@ -628,6 +629,9 @@ export class MessageModel extends AbstractModel { ); return clone.innerHTML; } + if (this.isPgpEncrypted()) { + return this.html() || plainToHtml(this.plain()); + } return ''; } diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index 0cd1b1a81..33edfb6f8 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -62,7 +62,7 @@ const mimeToMessage = (data, message) => { // TODO: Check multipart/signed application/pgp-signature application/pgp-keys const headers = data.split(/\r?\n\r?\n/)[0]; - if (/Content-Type:[\s\S]*?/.test(headers)) { + if (/Content-Type:/i.test(headers)) { // https://github.com/postalsys/postal-mime (new PostalMime).parse(data).then(result => { // TODO: multipart/signed @@ -284,7 +284,9 @@ export class MailMessageView extends AbstractViewRight { } messageEditCommand() { - this.editMessage(); + if (currentMessage()) { + showMessageComposer([ComposeType.Draft, currentMessage()]); + } } goUpCommand() { @@ -556,12 +558,6 @@ export class MailMessageView extends AbstractViewRight { showMessageComposer(); } - editMessage() { - if (currentMessage()) { - showMessageComposer([ComposeType.Draft, currentMessage()]); - } - } - scrollMessageToTop() { oMessageScrollerDom().scrollTop = (50 < oMessageScrollerDom().scrollTop) ? 50 : 0; }