mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
Update openpgpjs 0.3.0 -> 0.5.1 (#142)
This commit is contained in:
parent
1ed1efbe6c
commit
61a7a9c078
23 changed files with 160 additions and 228 deletions
|
|
@ -19,7 +19,10 @@ function PopupsAddOpenPgpKeyViewModel()
|
|||
this.addOpenPgpKeyCommand = Utils.createCommand(this, function () {
|
||||
|
||||
var
|
||||
iCount = 30,
|
||||
aMatch = null,
|
||||
sKey = Utils.trim(this.key()),
|
||||
oReg = /[\-]{3,6}BEGIN PGP (PRIVATE|PUBLIC) KEY BLOCK[\-]{3,6}[\s\S]+[\-]{3,6}END PGP (PRIVATE|PUBLIC) KEY BLOCK[\-]{3,6}/gi,
|
||||
oOpenpgpKeyring = RL.data().openpgpKeyring
|
||||
;
|
||||
|
||||
|
|
@ -30,7 +33,30 @@ function PopupsAddOpenPgpKeyViewModel()
|
|||
return false;
|
||||
}
|
||||
|
||||
oOpenpgpKeyring.importKey(sKey);
|
||||
do
|
||||
{
|
||||
aMatch = oReg.exec(sKey);
|
||||
if (!aMatch || 0 > iCount)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (aMatch[0] && aMatch[1] && aMatch[2] && aMatch[1] === aMatch[2])
|
||||
{
|
||||
if ('PRIVATE' === aMatch[1])
|
||||
{
|
||||
oOpenpgpKeyring.privateKeys.importKey(aMatch[0]);
|
||||
}
|
||||
else if ('PUBLIC' === aMatch[1])
|
||||
{
|
||||
oOpenpgpKeyring.publicKeys.importKey(aMatch[0]);
|
||||
}
|
||||
}
|
||||
|
||||
iCount--;
|
||||
}
|
||||
while (true);
|
||||
|
||||
oOpenpgpKeyring.store();
|
||||
|
||||
RL.reloadOpenPgpKeys();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue