1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-28 16:55:56 +00:00

Revert "Auto select certificate"

This reverts commit c02e5992ec.
This commit is contained in:
M66B 2019-12-04 13:30:23 +01:00
parent c02e5992ec
commit a26a462d5f

View file

@ -1264,39 +1264,10 @@ public class FragmentCompose extends FragmentBase {
args.putString("alias", alias); args.putString("alias", alias);
if (EntityMessage.SMIME_SIGNENCRYPT.equals(draft.encrypt)) { if (EntityMessage.SMIME_SIGNENCRYPT.equals(draft.encrypt)) {
new SimpleTask<Long>() { FragmentDialogCertificate fragment = new FragmentDialogCertificate();
@Override fragment.setArguments(args);
protected Long onExecute(Context context, Bundle args) throws Throwable { fragment.setTargetFragment(FragmentCompose.this, REQUEST_CERTIFICATE);
String email = args.getString("email"); fragment.show(getParentFragmentManager(), "compose:certificate");
if (email == null)
return null;
DB db = DB.getInstance(context);
List<EntityCertificate> 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");
} else } else
onSmime(args); onSmime(args);
} catch (Throwable ex) { } catch (Throwable ex) {