Commit 826419b9 authored by Patrick Brunschwig's avatar Patrick Brunschwig

changed key selection to return fingerprint

parent 0ec19803
......@@ -2147,7 +2147,7 @@ Enigmail.prototype = {
{
var args = Ec.getAgentArgs(true);
var keyIdList = keyId.split(" ");
args=args.concat([ "--fixed-list-mode", "--with-colons", "--list-keys"]);
args=args.concat([ "--fixed-list-mode", "--with-fingerprint", "--with-colons", "--list-keys"]);
args=args.concat(keyIdList);
var statusMsgObj = {};
......
......@@ -222,7 +222,7 @@ Enigmail.edit = {
try {
if (resultObj.cancelled) return;
var selKey = resultObj.userList[0];
selKey = "0x"+selKey.substring(10,18);
//selKey = "0x"+selKey.substring(10,18);
this.pgpKeyId.value = selKey;
} catch (ex) {
// cancel pressed -> don't send mail
......
......@@ -49,6 +49,7 @@ const CREATED = 5;
const EXPIRY = 6;
const USER_ID = 9;
const KEY_USE_FOR = 11;
const FPR = 9;
// key trust values for field 1 (as described in the doc/DETAILS file in the GnuPG distribution)
const KEY_EXPIRED="e";
......@@ -356,10 +357,14 @@ function enigmailBuildList(refresh)
}
userObj.valid=false;
userObj.uidValid=true;
userObj.fpr = "";
userObj.subkeyOK=(listRow[KEY_USE_FOR].indexOf("e") >= 0 || secretOnly);
userObj.SubUserIds=new Array();
aUserList.push(userObj);
break;
case "fpr":
userObj.fpr = listRow[FPR];
break;
case "grp":
// groups
userObj = new Object();
......@@ -705,6 +710,9 @@ function enigUserSelCreateRow (userObj, activeState, userId, keyValue, dateField
}
else {
treeItem.setAttribute("id", "0x"+userObj.keyId);
if (userObj.fpr.length > 0) {
treeItem.setAttribute("fpr", "0x"+userObj.fpr);
}
}
treeItem.appendChild(userRow);
return treeItem;
......@@ -722,21 +730,32 @@ function enigmailUserSelAccept()
var t = new String();
gUserList = document.getElementById("enigmailUserIdSelection");
var treeChildren=gUserList.getElementsByAttribute("id", "enigmailUserIdSelectionChildren")[0];
var item;
if (window.arguments[INPUT].options.indexOf("multisel")<0) {
if (gUserList.currentIndex >= 0) {
resultObj.userList.push(gUserList.view.getItemAtIndex(gUserList.currentIndex).getAttribute("id"));
// resultObj.userList.push(gUserList.currentItem.getAttribute("id"));
item = gUserList.view.getItemAtIndex(gUserList.currentIndex);
if (item.getAttribute("fpr")) {
resultObj.userList.push(item.getAttribute("fpr"));
}
else {
resultObj.userList.push(item.getAttribute("id"));
}
}
}
else {
var item=treeChildren.firstChild;
item=treeChildren.firstChild;
while (item) {
var aRows = item.getElementsByAttribute("id","indicator");
if (aRows.length) {
var elem=aRows[0];
if (elem.getAttribute("active") == "1") {
resultObj.userList.push(item.getAttribute("id"));
if (item.getAttribute("fpr")) {
resultObj.userList.push(item.getAttribute("fpr"));
}
else {
resultObj.userList.push(item.getAttribute("id"));
}
}
}
item = item.nextSibling;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment