diff options
author | Thialfihar <thi@thialfihar.org> | 2014-05-14 14:08:33 +0200 |
---|---|---|
committer | Thialfihar <thi@thialfihar.org> | 2014-05-14 14:28:26 +0200 |
commit | d50e798c13a6429f3a90341ee239f60cac832f1e (patch) | |
tree | 2ec187ae49ab6e192df0be9810bbc24adc7626ff /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport | |
parent | f4a8e71c338c03642514aba2026156d541d3eab8 (diff) | |
download | open-keychain-d50e798c13a6429f3a90341ee239f60cac832f1e.tar.gz open-keychain-d50e798c13a6429f3a90341ee239f60cac832f1e.tar.bz2 open-keychain-d50e798c13a6429f3a90341ee239f60cac832f1e.zip |
List full keybase id or strong key id matches on top
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java index 442cecef2..6fd4c3975 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/keyimport/KeybaseKeyServer.java @@ -55,10 +55,19 @@ public class KeybaseKeyServer extends KeyServer { // only list them if they have a key if (JWalk.optObject(match, "components", "key_fingerprint") != null) { - results.add(makeEntry(match)); + String keybaseId = JWalk.getString(match, "components", "username", "val"); + String fingerprint = JWalk.getString(match, "components", "key_fingerprint", "val"); + fingerprint = fingerprint.replace(" ", "").toUpperCase(); + + if (keybaseId.equals(query) || fingerprint.startsWith(query.toUpperCase())) { + results.add(makeEntry(match)); + } else { + results.add(makeEntry(match)); + } } } } catch (Exception e) { + Log.e(Constants.TAG, "keybase result parsing error", e); throw new QueryException("Unexpected structure in keybase search result: " + e.getMessage()); } |