Store origin with ImportKeysListEntry

This commit is contained in:
mar-v-in 2014-05-27 20:17:49 +02:00
parent 3110122a85
commit 8e5767f967
3 changed files with 13 additions and 0 deletions

View File

@ -244,6 +244,7 @@ public class HkpKeyserver extends Keyserver {
while (matcher.find()) {
final ImportKeysListEntry entry = new ImportKeysListEntry();
entry.setQuery(query);
entry.setOrigin("hkp:"+mHost+":"+mPort);
entry.setBitStrength(Integer.parseInt(matcher.group(3)));

View File

@ -52,6 +52,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
public String mPrimaryUserId;
private String mExtraData;
private String mQuery;
private String mOrigin;
private boolean mSelected;
@ -77,6 +78,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
dest.writeInt(mBytes.length);
dest.writeByteArray(mBytes);
dest.writeString(mExtraData);
dest.writeString(mOrigin);
}
public static final Creator<ImportKeysListEntry> CREATOR = new Creator<ImportKeysListEntry>() {
@ -97,6 +99,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
vr.mBytes = new byte[source.readInt()];
source.readByteArray(vr.mBytes);
vr.mExtraData = source.readString();
vr.mOrigin = source.readString();
return vr;
}
@ -218,6 +221,14 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
mQuery = query;
}
public String getOrigin() {
return mOrigin;
}
public void setOrigin(String origin) {
mOrigin = origin;
}
/**
* Constructor for later querying from keyserver
*/

View File

@ -87,6 +87,7 @@ public class KeybaseKeyserver extends Keyserver {
final ImportKeysListEntry entry = new ImportKeysListEntry();
entry.setQuery(mQuery);
entry.setOrigin("keybase.io");
String keybaseId = JWalk.getString(match, "components", "username", "val");
String fullName = JWalk.getString(match, "components", "full_name", "val");