mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
Changes should now be in sync with dominik
This commit is contained in:
parent
b5fb311c61
commit
4c693b4509
@ -112,12 +112,15 @@ public class KeybaseKeyServer extends KeyServer {
|
|||||||
entry.setDate(tmpGreg.getTime());
|
entry.setDate(tmpGreg.getTime());
|
||||||
|
|
||||||
// key bits
|
// key bits
|
||||||
|
// we have to fetch the user object to construct the search-result list, so we might as
|
||||||
|
// well (weakly) remember the key, in case they try to import it
|
||||||
mKeyCache.put(keybaseID, JWalk.getString(match,"them", "public_keys", "primary", "bundle"));
|
mKeyCache.put(keybaseID, JWalk.getString(match,"them", "public_keys", "primary", "bundle"));
|
||||||
|
|
||||||
// String displayName = JWalk.getString(match, "them", "profile", "full_name");
|
// String displayName = JWalk.getString(match, "them", "profile", "full_name");
|
||||||
ArrayList<String> userIds = new ArrayList<String>();
|
ArrayList<String> userIds = new ArrayList<String>();
|
||||||
String name = "keybase.io/" + keybaseID + " <" + keybaseID + "@keybase.io>";
|
String name = "keybase.io/" + keybaseID + " <" + keybaseID + "@keybase.io>";
|
||||||
userIds.add(name);
|
userIds.add(name);
|
||||||
|
userIds.add(keybaseID);
|
||||||
entry.setUserIds(userIds);
|
entry.setUserIds(userIds);
|
||||||
entry.setPrimaryUserId(name);
|
entry.setPrimaryUserId(name);
|
||||||
return entry;
|
return entry;
|
||||||
@ -157,12 +160,10 @@ public class KeybaseKeyServer extends KeyServer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String get(String id) throws QueryException {
|
public String get(String id) throws QueryException {
|
||||||
// id is like "keybase/username"
|
String key = mKeyCache.get(id);
|
||||||
String keybaseID = id.substring(id.indexOf('/') + 1);
|
|
||||||
String key = mKeyCache.get(keybaseID);
|
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
try {
|
try {
|
||||||
JSONObject user = getUser(keybaseID);
|
JSONObject user = getUser(id);
|
||||||
key = JWalk.getString(user, "them", "public_keys", "primary", "bundle");
|
key = JWalk.getString(user, "them", "public_keys", "primary", "bundle");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new QueryException(e.getMessage());
|
throw new QueryException(e.getMessage());
|
||||||
|
Loading…
Reference in New Issue
Block a user