Make keybase lookup works for key ids starting with 0x

This commit is contained in:
Thialfihar 2014-05-14 14:07:44 +02:00
parent 638554f256
commit f4a8e71c33

View File

@ -41,6 +41,11 @@ public class KeybaseKeyServer extends KeyServer {
InsufficientQuery {
ArrayList<ImportKeysListEntry> results = new ArrayList<ImportKeysListEntry>();
if (query.startsWith("0x")) {
// cut off "0x" if a user is searching for a key id
query = query.substring(2);
}
JSONObject fromQuery = getFromKeybase("_/api/1.0/user/autocomplete.json?q=", query);
try {
@ -158,4 +163,4 @@ public class KeybaseKeyServer extends KeyServer {
public void add(String armoredKey) throws AddKeyException {
throw new AddKeyException();
}
}
}