mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Split OpenPGP.js and GnuPG from PgpUserStore
This commit is contained in:
parent
76226f45ca
commit
76361a13da
6 changed files with 453 additions and 369 deletions
|
|
@ -29,6 +29,7 @@ import { IdentityUserStore } from 'Stores/User/Identity';
|
|||
import { AccountUserStore } from 'Stores/User/Account';
|
||||
import { FolderUserStore } from 'Stores/User/Folder';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||
import { MessageUserStore } from 'Stores/User/Message';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
|
@ -458,10 +459,10 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
if ('openpgp' == sign) {
|
||||
let privateKey;
|
||||
try {
|
||||
const keys = PgpUserStore.getOpenPGPPrivateKeyFor(this.currentIdentity().email());
|
||||
if (keys[0]) {
|
||||
keys[0].decrypt(window.prompt('Passphrase'));
|
||||
cfg.privateKey = privateKey = keys[0];
|
||||
const key = OpenPGPUserStore.getPrivateKeyFor(this.currentIdentity().email());
|
||||
if (key) {
|
||||
key.decrypt(window.prompt('Passphrase'));
|
||||
cfg.privateKey = privateKey = key;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
@ -477,7 +478,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
// error 'sign and encrypt must be same engine';
|
||||
} else if ('openpgp' == encrypt) {
|
||||
this.allRecipients().forEach(recEmail => {
|
||||
cfg.publicKeys = cfg.publicKeys.concat(PgpUserStore.getOpenPGPPublicKeyFor(recEmail));
|
||||
cfg.publicKeys = cfg.publicKeys.concat(OpenPGPUserStore.getPublicKeyFor(recEmail));
|
||||
});
|
||||
pgpPromise = openpgp.encrypt(cfg);
|
||||
} else if ('openpgp' == sign) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue