From 38c389989c09e0b681d071fdd7c3a4c94744dccf Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 22 Aug 2020 22:20:06 +0200 Subject: [PATCH] Identity insecure STARTTLS --- .../java/eu/faircode/email/FragmentIdentity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 4710e97620..5dd00a5c23 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -418,6 +418,17 @@ public class FragmentIdentity extends FragmentBase { } }); + cbInsecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + Object tag = cbInsecure.getTag(); + if (tag != null && tag.equals(isChecked)) + return; + if (isChecked) + rgEncryption.check(R.id.radio_starttls); + } + }); + btnCertificate.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -1084,6 +1095,7 @@ public class FragmentIdentity extends FragmentBase { etHost.setText(identity == null ? null : identity.host); rgEncryption.check(identity != null && identity.starttls ? R.id.radio_starttls : R.id.radio_ssl); + cbInsecure.setTag(identity == null ? false : identity.insecure); cbInsecure.setChecked(identity == null ? false : identity.insecure); etPort.setText(identity == null ? null : Long.toString(identity.port)); etUser.setText(identity == null ? null : identity.user);