mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-31 03:52:01 +08:00
#89 solve edit/reply encrypted message/draft
This commit is contained in:
parent
686138ae15
commit
96de0be977
2 changed files with 9 additions and 9 deletions
|
@ -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 '';
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue