mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
OpenPGP (#53) UNSTABLE
This commit is contained in:
parent
67b5a72a71
commit
b330f77bc0
14 changed files with 526 additions and 260 deletions
|
|
@ -64,6 +64,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
|||
this.openPgpKeyForDeletion(null);
|
||||
|
||||
var
|
||||
iFindIndex = -1,
|
||||
oOpenpgpKeyring = RL.data().openpgpKeyring,
|
||||
fRemoveAccount = function (oOpenPgpKey) {
|
||||
return oOpenPgpKeyToRemove === oOpenPgpKey;
|
||||
|
|
@ -74,7 +75,20 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
|||
{
|
||||
this.openpgpkeys.remove(fRemoveAccount);
|
||||
|
||||
oOpenpgpKeyring.removeKey(oOpenPgpKeyToRemove.index);
|
||||
_.each(oOpenpgpKeyring.keys, function (oKey, iIndex) {
|
||||
if (-1 === iFindIndex && oKey && oKey.primaryKey &&
|
||||
oOpenPgpKeyToRemove.guid === oKey.primaryKey.getFingerprint() &&
|
||||
oOpenPgpKeyToRemove.isPrivate === oKey.isPrivate())
|
||||
{
|
||||
iFindIndex = iIndex;
|
||||
}
|
||||
});
|
||||
|
||||
if (0 <= iFindIndex)
|
||||
{
|
||||
oOpenpgpKeyring.removeKey(iFindIndex);
|
||||
}
|
||||
|
||||
oOpenpgpKeyring.store();
|
||||
|
||||
RL.reloadOpenPgpKeys();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue