mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
Added comments for server result sorting in key search
This commit is contained in:
parent
74c474e3e2
commit
aab32b81b9
@ -70,6 +70,7 @@ public class ImportKeysList extends ArrayList<ImportKeysListEntry> {
|
|||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// keep track if this key result is from a HKP keyserver
|
||||||
boolean incomingFromHkpServer = true;
|
boolean incomingFromHkpServer = true;
|
||||||
// we’re going to want to try to fetch the key from everywhere we found it, so remember
|
// we’re going to want to try to fetch the key from everywhere we found it, so remember
|
||||||
// all the origins
|
// all the origins
|
||||||
@ -79,6 +80,7 @@ public class ImportKeysList extends ArrayList<ImportKeysListEntry> {
|
|||||||
// to work properly, Keybase-sourced entries need to pass along the extra
|
// to work properly, Keybase-sourced entries need to pass along the extra
|
||||||
if (KeybaseKeyserver.ORIGIN.equals(origin)) {
|
if (KeybaseKeyserver.ORIGIN.equals(origin)) {
|
||||||
existing.setExtraData(incoming.getExtraData());
|
existing.setExtraData(incoming.getExtraData());
|
||||||
|
// one of the origins is not a HKP keyserver
|
||||||
incomingFromHkpServer = false;
|
incomingFromHkpServer = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,6 +89,10 @@ public class ImportKeysList extends ArrayList<ImportKeysListEntry> {
|
|||||||
ArrayList<String> existingIDs = existing.getUserIds();
|
ArrayList<String> existingIDs = existing.getUserIds();
|
||||||
for (String incomingID : incomingIDs) {
|
for (String incomingID : incomingIDs) {
|
||||||
if (!existingIDs.contains(incomingID)) {
|
if (!existingIDs.contains(incomingID)) {
|
||||||
|
// prepend HKP server results to the start of the list,
|
||||||
|
// so that the UI (for cloud key search, which is picking the first list item)
|
||||||
|
// shows the right main email address, as mail addresses returned by HKP servers
|
||||||
|
// are preferred over keybase.io IDs
|
||||||
if (incomingFromHkpServer) {
|
if (incomingFromHkpServer) {
|
||||||
existingIDs.add(0, incomingID);
|
existingIDs.add(0, incomingID);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user