diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-11-19 22:22:18 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-11-19 22:22:18 +0100 |
commit | 1c0f994d082bde6d6b0a6783e8d81a1d80d86a23 (patch) | |
tree | ec270e4573cab699084e152ccaf85f4d85097ba6 | |
parent | 6691f5118a1eb59d6a9334f44877f0bece1c1247 (diff) | |
parent | 0f59e6bd950087d99a0909e55276e649639bb51b (diff) | |
download | open-keychain-1c0f994d082bde6d6b0a6783e8d81a1d80d86a23.tar.gz open-keychain-1c0f994d082bde6d6b0a6783e8d81a1d80d86a23.tar.bz2 open-keychain-1c0f994d082bde6d6b0a6783e8d81a1d80d86a23.zip |
Merge branch 'keybase-proofs' of github.com:open-keychain/open-keychain into keybase-proofs
3 files changed, 21 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java index 4965b2525..ef14299b1 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java @@ -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; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index 6c81e9193..f3dce5823 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -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(); diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 9596cccc1..27c81fe21 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -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> |