diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index 204be4512b..4dbd33d1dd 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -65,6 +65,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private Button btnEditSignature; private SwitchCompat swDiscardDelete; + private SwitchCompat swAutoLink; private SwitchCompat swPlainOnly; private SwitchCompat swFormatFlowed; private SwitchCompat swUsenetSignature; @@ -80,7 +81,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc "compose_font", "prefix_once", "separate_reply", "extended_reply", "write_below", "quote_reply", "quote_limit", "resize_reply", "signature_location", "signature_reply", "signature_forward", "discard_delete", - "plain_only", "format_flowed", "usenet_signature", "remove_signatures", + "auto_link", "plain_only", "format_flowed", "usenet_signature", "remove_signatures", "receipt_default", "receipt_type", "lookup_mx" }; @@ -118,6 +119,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc btnEditSignature = view.findViewById(R.id.btnEditSignature); swDiscardDelete = view.findViewById(R.id.swDiscardDelete); + swAutoLink = view.findViewById(R.id.swAutoLink); swPlainOnly = view.findViewById(R.id.swPlainOnly); swFormatFlowed = view.findViewById(R.id.swFormatFlowed); swUsenetSignature = view.findViewById(R.id.swUsenetSignature); @@ -319,6 +321,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + swAutoLink.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("auto_link", checked).apply(); + } + }); + swPlainOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -449,6 +458,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc swSignatureForward.setChecked(prefs.getBoolean("signature_forward", true)); swDiscardDelete.setChecked(prefs.getBoolean("discard_delete", false)); + swAutoLink.setChecked(prefs.getBoolean("auto_link", false)); swPlainOnly.setChecked(prefs.getBoolean("plain_only", false)); swFormatFlowed.setChecked(prefs.getBoolean("format_flowed", false)); swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false)); diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 416ca398b6..590d3aa442 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -617,13 +617,15 @@ public class MessageHelper { boolean format_flowed = prefs.getBoolean("format_flowed", false); boolean monospaced = prefs.getBoolean("monospaced", false); String compose_font = prefs.getString("compose_font", monospaced ? "monospace" : "sans-serif"); + boolean auto_link = prefs.getBoolean("auto_link", false); // Build html body Document document = JsoupEx.parse(message.getFile(context)); // When sending message if (identity != null && send) { - HtmlHelper.autoLink(document); + if (auto_link) + HtmlHelper.autoLink(document); for (Element child : document.body().children()) if (!TextUtils.isEmpty(child.text()) && diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index c6289aac53..49a8d1fc0c 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -402,6 +402,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/swDiscardDelete" /> + + Signature position Use signature when replying Use signature when forwarding + Automatically create links Send plain text only by default \'format flowed\' for plain text When requesting a receipt