From 690b5c5dc8b5a7403e779d2155471d16473aefc6 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 4 Feb 2020 12:25:13 +0100 Subject: [PATCH] Show signature users --- .../eu/faircode/email/FragmentMessages.java | 19 ++++++++++++++----- app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 792ccbff1a..fac3a79190 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4777,11 +4777,20 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. int sresult = (sigResult == null ? RESULT_NO_SIGNATURE : sigResult.getResult()); if (sresult == RESULT_NO_SIGNATURE) Snackbar.make(view, R.string.title_signature_none, Snackbar.LENGTH_LONG).show(); - else if (sresult == RESULT_VALID_KEY_CONFIRMED) - Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG).show(); - else if (sresult == RESULT_VALID_KEY_UNCONFIRMED) - Snackbar.make(view, R.string.title_signature_unconfirmed, Snackbar.LENGTH_LONG).show(); - else + else if (sresult == RESULT_VALID_KEY_CONFIRMED || sresult == RESULT_VALID_KEY_UNCONFIRMED) { + List users = sigResult.getConfirmedUserIds(); + String text; + if (users.size() > 0) + text = getString(sresult == RESULT_VALID_KEY_UNCONFIRMED + ? R.string.title_signature_unconfirmed_from + : R.string.title_signature_valid_from, + TextUtils.join(", ", users)); + else + text = getString(sresult == RESULT_VALID_KEY_UNCONFIRMED + ? R.string.title_signature_unconfirmed + : R.string.title_signature_valid); + Snackbar.make(view, text, Snackbar.LENGTH_LONG).show(); + } else Snackbar.make(view, R.string.title_signature_invalid, Snackbar.LENGTH_LONG).show(); break; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d45475b89d..a0159f8170 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -802,7 +802,9 @@ Message not signed Message signature valid + Message signature valid: %1$s Message signature valid but not confirmed + Message signature valid but not confirmed: %1$s Message signature invalid Message signature invalid: %1$s Certificate chain invalid