From dea9741aa5d38af0c51a0a32018167a170bc4387 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 2 Sep 2021 14:16:55 +0200 Subject: [PATCH] Revert "Removed PGP sign key shortcut" This reverts commit 3e5bcf83050fff98879666b72c0d3aecd9ed704d. --- .../eu/faircode/email/FragmentCompose.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index ed77849df8..e5cf629b4c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -3053,11 +3053,19 @@ public class FragmentCompose extends FragmentBase { } } - // Call OpenPGP - Log.i("Executing " + data.getAction()); - Log.logExtras(data); - OpenPgpApi api = new OpenPgpApi(context, pgpService.getService()); - Intent result = api.executeApi(data, new FileInputStream(input), new FileOutputStream(output)); + Intent result; + if (OpenPgpApi.ACTION_GET_SIGN_KEY_ID.equals(data.getAction()) && identity.sign_key != null) { + // Short circuit + result = data; + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); + result.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, identity.sign_key); + } else { + // Call OpenPGP + Log.i("Executing " + data.getAction()); + Log.logExtras(data); + OpenPgpApi api = new OpenPgpApi(context, pgpService.getService()); + result = api.executeApi(data, new FileInputStream(input), new FileOutputStream(output)); + } // Process result try {