mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
In the ImportKeysList display, arrange for Keybase UserIDs to sort below the rest. Also mention Keybase stuff other than Twitter/GitHub/Website
This commit is contained in:
parent
4dab361b1b
commit
0f59e6bd95
@ -268,14 +268,15 @@ public class ViewKeyTrustFragment extends LoaderFragment implements
|
||||
if (haveProofFor(proof.getType())) {
|
||||
ssb.append("\u00a0[");
|
||||
startAt = ssb.length();
|
||||
ssb.append("Verify");
|
||||
String verify = getString(R.string.keybase_verify);
|
||||
ssb.append(verify);
|
||||
ClickableSpan clicker = new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
verify(proof, fingerprint);
|
||||
}
|
||||
};
|
||||
ssb.setSpan(clicker, startAt, startAt + "Verify".length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ssb.setSpan(clicker, startAt, startAt + verify.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
ssb.append("]");
|
||||
}
|
||||
return ssb;
|
||||
|
@ -213,8 +213,24 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
||||
// destroyLoader view from holder
|
||||
holder.userIdsList.removeAllViews();
|
||||
|
||||
// we want conventional gpg UserIDs first, then Keybase ”proofs”
|
||||
HashMap<String, HashSet<String>> mergedUserIds = entry.getMergedUserIds();
|
||||
for (Map.Entry<String, HashSet<String>> pair : mergedUserIds.entrySet()) {
|
||||
ArrayList<Map.Entry<String, HashSet<String>>> sortedIds = new ArrayList<Map.Entry<String, HashSet<String>>>(mergedUserIds.entrySet());
|
||||
java.util.Collections.sort(sortedIds, new java.util.Comparator<Map.Entry<String, HashSet<String>>>() {
|
||||
@Override
|
||||
public int compare(Map.Entry<String, HashSet<String>> entry1, Map.Entry<String, HashSet<String>> entry2) {
|
||||
|
||||
// sort keybase UserIds after non-Keybase
|
||||
boolean e1IsKeybase = entry1.getKey().contains(":");
|
||||
boolean e2IsKeybase = entry2.getKey().contains(":");
|
||||
if (e1IsKeybase != e2IsKeybase) {
|
||||
return (e1IsKeybase) ? 1 : -1;
|
||||
}
|
||||
return entry1.getKey().compareTo(entry2.getKey());
|
||||
}
|
||||
});
|
||||
|
||||
for (Map.Entry<String, HashSet<String>> pair : sortedIds) {
|
||||
String cUserId = pair.getKey();
|
||||
HashSet<String> cEmails = pair.getValue();
|
||||
|
||||
|
@ -575,6 +575,7 @@
|
||||
<string name="keybase_github_proof">"A gist"</string>
|
||||
<string name="keybase_reddit_proof">"A JSON file"</string>
|
||||
<string name="keybase_reddit_attribution">"attributed by Reddit to"</string>
|
||||
<string name="keybase_verify">"Verify"</string>
|
||||
|
||||
<!-- Edit key -->
|
||||
<string name="edit_key_action_change_passphrase">"Change Passphrase"</string>
|
||||
|
Loading…
Reference in New Issue
Block a user