mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Improved Composer handling with PGP messages
This commit is contained in:
parent
96de0be977
commit
3fc5216841
5 changed files with 103 additions and 125 deletions
|
|
@ -67,6 +67,13 @@ export const PgpUserStore = new class {
|
|||
return !!(OpenPGPUserStore.isSupported() || GnuPGUserStore.isSupported() || window.mailvelope);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isEncrypted(text) {
|
||||
return 0 === text.trim().indexOf('-----BEGIN PGP MESSAGE-----');
|
||||
}
|
||||
|
||||
async mailvelopeHasPublicKeyForEmails(recipients, all) {
|
||||
const
|
||||
keyring = this.mailvelopeKeyring,
|
||||
|
|
@ -129,7 +136,7 @@ export const PgpUserStore = new class {
|
|||
const sender = message.from[0].email,
|
||||
armoredText = message.plain();
|
||||
|
||||
if (!armoredText.includes('-----BEGIN PGP MESSAGE-----')) {
|
||||
if (!this.isEncrypted(armoredText)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue