#89 solve edit/reply encrypted message/draft

This commit is contained in:
the-djmaze 2022-02-04 09:54:59 +01:00
parent 686138ae15
commit 96de0be977
2 changed files with 9 additions and 9 deletions

View file

@ -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 '';
}

View file

@ -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;
}