From ec9947aad289138dde266bd14bce856e8a0e9aa6 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 7 Nov 2019 11:15:02 +0100 Subject: [PATCH] Added option to disable quoting reply --- .../java/eu/faircode/email/FragmentCompose.java | 10 +++++++--- .../eu/faircode/email/FragmentOptionsSend.java | 14 +++++++++++++- app/src/main/res/layout/fragment_options_send.xml | 14 +++++++++++++- app/src/main/res/values/strings.xml | 3 ++- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 51201f48cb..6e9fa12c08 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2517,9 +2517,6 @@ public class FragmentCompose extends FragmentBase { } } - if ("reply".equals(action) || "reply_all".equals(action)) - refText = "
" + refText + "
"; - // Build reply header StringBuilder sb = new StringBuilder(); DateFormat DF = Helper.getDateTimeInstance(context); @@ -2551,7 +2548,14 @@ public class FragmentCompose extends FragmentBase { sb.append("

\n"); } + boolean quote_reply = prefs.getBoolean("quote_reply", true); + boolean quote = (quote_reply && ("reply".equals(action) || "reply_all".equals(action))); + if (quote) + sb.append("
"); sb.append(refText); + if (quote) + sb.append("
"); + Helper.writeText(data.draft.getRefFile(context), sb.toString()); } diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index fab84725c1..b15daa4530 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -49,6 +49,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private Button btnLocalContacts; private SwitchCompat swPrefixOnce; private SwitchCompat swExtendedReply; + private SwitchCompat swQuoteReply; private SwitchCompat swPlainOnly; private SwitchCompat swUsenetSignature; private SwitchCompat swAutoResize; @@ -60,7 +61,9 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc private Spinner spSendDelayed; private final static String[] RESET_OPTIONS = new String[]{ - "keyboard", "suggest_sent", "suggested_received", "prefix_once", "extended_reply", "plain_only", "usenet_signature", + "keyboard", "suggest_sent", "suggested_received", + "prefix_once", "extended_reply", "quote_reply", + "plain_only", "usenet_signature", "autoresize", "encrypt_default", "receipt_default", "resize", "lookup_mx", "send_delayed" }; @@ -80,6 +83,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc btnLocalContacts = view.findViewById(R.id.btnLocalContacts); swPrefixOnce = view.findViewById(R.id.swPrefixOnce); swExtendedReply = view.findViewById(R.id.swExtendedReply); + swQuoteReply = view.findViewById(R.id.swQuoteReply); swPlainOnly = view.findViewById(R.id.swPlainOnly); swUsenetSignature = view.findViewById(R.id.swUsenetSignature); swAutoResize = view.findViewById(R.id.swAutoResize); @@ -139,6 +143,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + swQuoteReply.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("quote_reply", checked).apply(); + } + }); + swPlainOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -260,6 +271,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc swSuggestReceived.setChecked(prefs.getBoolean("suggest_received", false)); swPrefixOnce.setChecked(prefs.getBoolean("prefix_once", true)); swExtendedReply.setChecked(prefs.getBoolean("extended_reply", false)); + swQuoteReply.setChecked(prefs.getBoolean("quote_reply", true)); swPlainOnly.setChecked(prefs.getBoolean("plain_only", false)); swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false)); diff --git a/app/src/main/res/layout/fragment_options_send.xml b/app/src/main/res/layout/fragment_options_send.xml index db740d75a0..7aac58cc4f 100644 --- a/app/src/main/res/layout/fragment_options_send.xml +++ b/app/src/main/res/layout/fragment_options_send.xml @@ -119,6 +119,18 @@ app:layout_constraintTop_toBottomOf="@id/swPrefixOnce" app:switchPadding="12dp" /> + + Suggest addresses found in sent messages Suggest addresses found in received messages Prefix subject only once on replying or forwarding - Use extended reply header + Use extended reply/forward header + Quote replied text Send plain text only by default Usenet signature convention Automatically resize attached and embedded images