From 7fbfdfd21ebb63ab1500131277736bff847d864f Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 9 Feb 2020 18:44:12 +0100 Subject: [PATCH] Added PGP key missing message --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 ++++++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 198c5c434e..02a4058087 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -202,6 +202,7 @@ import static android.os.Process.THREAD_PRIORITY_BACKGROUND; import static android.text.format.DateUtils.DAY_IN_MILLIS; import static android.text.format.DateUtils.FORMAT_SHOW_DATE; import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY; +import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_KEY_MISSING; import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_NO_SIGNATURE; import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_VALID_KEY_CONFIRMED; import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_VALID_KEY_UNCONFIRMED; @@ -4808,6 +4809,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. // Check signature status OpenPgpSignatureResult sigResult = result.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE); int sresult = (sigResult == null ? RESULT_NO_SIGNATURE : sigResult.getResult()); + if (sigResult == null) + Log.w("PGP signature result missing"); + else + Log.i("PGP signature result=" + sresult); if (sresult == RESULT_NO_SIGNATURE) Snackbar.make(view, R.string.title_signature_none, Snackbar.LENGTH_LONG).show(); else if (sresult == RESULT_VALID_KEY_CONFIRMED || sresult == RESULT_VALID_KEY_UNCONFIRMED) { @@ -4823,7 +4828,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. ? R.string.title_signature_unconfirmed : R.string.title_signature_valid); Snackbar.make(view, text, Snackbar.LENGTH_LONG).show(); - } else + } else if (sresult == RESULT_KEY_MISSING) + Snackbar.make(view, R.string.title_signature_key_missing, 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 36e23f401b..ffb66005ec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -812,6 +812,7 @@ Message signature valid but not confirmed: %1$s Message signature invalid Message signature invalid: %1$s + Key missing Certificate chain invalid Sender\'s address Signature\'s address