From 2d3e5efcc407dbaccac636fb9418a06257242518 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 1 Dec 2019 10:14:42 +0100 Subject: [PATCH] Short circuit get sign key ID --- .../java/eu/faircode/email/FragmentCompose.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 1623633d49..8a3b6fb521 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1574,10 +1574,17 @@ 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) { + result = data; + result.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS); + result.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, identity.sign_key); + } else { + 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 {