mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
#89 Composer move sign/encrypt buttons from menu to view
This commit is contained in:
parent
26d3509e28
commit
5b051745fe
6 changed files with 152 additions and 174 deletions
|
|
@ -74,33 +74,28 @@ export const PgpUserStore = new class {
|
|||
return 0 === text.trim().indexOf('-----BEGIN PGP MESSAGE-----');
|
||||
}
|
||||
|
||||
async mailvelopeHasPublicKeyForEmails(recipients, all) {
|
||||
async mailvelopeHasPublicKeyForEmails(recipients) {
|
||||
const
|
||||
keyring = this.mailvelopeKeyring,
|
||||
mailvelope = keyring && await keyring.validKeyForAddress(recipients)
|
||||
/*.then(LookupResult => Object.entries(LookupResult))*/,
|
||||
entries = mailvelope && Object.entries(mailvelope);
|
||||
return !!(entries && (all ? (entries.filter(value => value[1]).length === recipients.length) : entries.length));
|
||||
return entries && entries.filter(value => value[1]).length === recipients.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if verifying/encrypting a message is possible with given email addresses.
|
||||
* Returns the first library that can.
|
||||
*/
|
||||
async hasPublicKeyForEmails(recipients, all) {
|
||||
async hasPublicKeyForEmails(recipients) {
|
||||
const count = recipients.length;
|
||||
if (count) {
|
||||
if (OpenPGPUserStore.hasPublicKeyForEmails(recipients, all)) {
|
||||
if (OpenPGPUserStore.hasPublicKeyForEmails(recipients)) {
|
||||
return 'openpgp';
|
||||
}
|
||||
|
||||
if (GnuPGUserStore.hasPublicKeyForEmails(recipients, all)) {
|
||||
if (GnuPGUserStore.hasPublicKeyForEmails(recipients)) {
|
||||
return 'gnupg';
|
||||
}
|
||||
|
||||
if (await this.mailvelopeHasPublicKeyForEmails(recipients, all)) {
|
||||
return 'mailvelope';
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue