From a26a462d5fd2de4201fc28d1a4e61ea05535f9e2 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 4 Dec 2019 13:30:23 +0100 Subject: [PATCH] Revert "Auto select certificate" This reverts commit c02e5992ec27885100d4f5c2e56528a39f5edd17. --- .../eu/faircode/email/FragmentCompose.java | 37 ++----------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 2778524c64..5f7e4f9b8e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1264,39 +1264,10 @@ public class FragmentCompose extends FragmentBase { args.putString("alias", alias); if (EntityMessage.SMIME_SIGNENCRYPT.equals(draft.encrypt)) { - new SimpleTask() { - @Override - protected Long onExecute(Context context, Bundle args) throws Throwable { - String email = args.getString("email"); - if (email == null) - return null; - - DB db = DB.getInstance(context); - List certs = db.certificate().getCertificateByEmail(email); - if (certs == null || certs.size() != 1) - return null; - - return certs.get(0).id; - } - - @Override - protected void onExecuted(Bundle args, Long id) { - if (id == null) { - FragmentDialogCertificate fragment = new FragmentDialogCertificate(); - fragment.setArguments(args); - fragment.setTargetFragment(FragmentCompose.this, REQUEST_CERTIFICATE); - fragment.show(getParentFragmentManager(), "certificate:select"); - } else { - args.putLong("certificate", id); - onSmime(args); - } - } - - @Override - protected void onException(Bundle args, Throwable ex) { - Helper.unexpectedError(getParentFragmentManager(), ex); - } - }.execute(FragmentCompose.this, args, "certificate:find"); + FragmentDialogCertificate fragment = new FragmentDialogCertificate(); + fragment.setArguments(args); + fragment.setTargetFragment(FragmentCompose.this, REQUEST_CERTIFICATE); + fragment.show(getParentFragmentManager(), "compose:certificate"); } else onSmime(args); } catch (Throwable ex) {