revert decrypt button enabling; allow to select sign key

This commit is contained in:
Carles Escrig Royo 2016-04-20 19:56:14 +02:00
parent 12f619bda7
commit 412ba464c8
No known key found for this signature in database
GPG key ID: 5E6F07C704111773
5 changed files with 129 additions and 37 deletions

View file

@ -83,10 +83,10 @@
if (0 === aResult.length && Utils.isNonEmptyArray(aRecipients))
{
aResult = _.compact(_.flatten(_.map(aRecipients, function (sEmail) {
var oKey = sEmail ? self.findPrivateKeyByEmailNotNative(sEmail) : null;
return oKey ? (bReturnWrapKeys ? [oKey] : oKey.getNativeKeys()) : [null];
}), true));
aResult = _.uniq(_.compact(_.flatten(_.map(aRecipients, function (sEmail) {
var aKeys = sEmail ? self.findAllPrivateKeysByEmailNotNative(sEmail) : null;
return aKeys ? (bReturnWrapKeys ? aKeys : _.flatten(_.map(aKeys, function (oKey) { return oKey.getNativeKeys(); }), true)) : [null];
}), true)), function (oKey) { return oKey.id; });
}
return aResult;
@ -114,6 +114,28 @@
}) || null;
};
/**
* @param {string} sEmail
* @return {?}
*/
PgpUserStore.prototype.findAllPublicKeysByEmailNotNative = function (sEmail)
{
return _.filter(this.openpgpkeysPublic(), function (oItem) {
return oItem && -1 !== oItem.emails.indexOf(sEmail);
}) || null;
};
/**
* @param {string} sEmail
* @return {?}
*/
PgpUserStore.prototype.findAllPrivateKeysByEmailNotNative = function (sEmail)
{
return _.filter(this.openpgpkeysPrivate(), function (oItem) {
return oItem && -1 !== oItem.emails.indexOf(sEmail);
}) || null;
};
/**
* @param {string} sEmail
* @param {string=} sPassword