mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Automaticaly add PGP key from Autocrypt #89
This commit is contained in:
parent
e28085fbba
commit
17cb093b32
3 changed files with 55 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { addObservablesTo } from 'External/ko';
|
||||
import { GnuPGUserStore } from 'Stores/User/GnuPG';
|
||||
import { OpenPGPUserStore } from 'Stores/User/OpenPGP';
|
||||
import { PgpUserStore } from 'Stores/User/Pgp';
|
||||
|
||||
import { AbstractViewPopup } from 'Knoin/AbstractViews';
|
||||
|
||||
|
|
@ -94,23 +94,8 @@ export class OpenPgpImportPopupView extends AbstractViewPopup {
|
|||
if (match[0] && match[1] && match[2] && match[1] === match[2]) {
|
||||
const GnuPG = this.saveGnuPG() && GnuPGUserStore.isSupported(),
|
||||
backup = this.saveServer();
|
||||
if (GnuPG || backup()) {
|
||||
Remote.request('PgpImportKey',
|
||||
(iError, oData) => {
|
||||
if (GnuPG && oData?.Result/* && (oData.Result.imported || oData.Result.secretimported)*/) {
|
||||
GnuPGUserStore.loadKeyrings();
|
||||
}
|
||||
iError && alert(oData.ErrorMessage);
|
||||
}, {
|
||||
key: this.key(),
|
||||
gnuPG: GnuPG,
|
||||
backup: backup
|
||||
}
|
||||
);
|
||||
}
|
||||
OpenPGPUserStore.isSupported() && OpenPGPUserStore.importKey(this.key());
|
||||
PgpUserStore.importKey(this.key(), GnuPG, backup);
|
||||
}
|
||||
|
||||
--count;
|
||||
done = false;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue