Added option to disable quoting reply

This commit is contained in:
M66B
2019-11-07 11:15:02 +01:00
parent b053d4103a
commit ec9947aad2
4 changed files with 35 additions and 6 deletions

View File

@@ -2517,9 +2517,6 @@ public class FragmentCompose extends FragmentBase {
}
}
if ("reply".equals(action) || "reply_all".equals(action))
refText = "<blockquote>" + refText + "</blockquote>";
// Build reply header
StringBuilder sb = new StringBuilder();
DateFormat DF = Helper.getDateTimeInstance(context);
@@ -2551,7 +2548,14 @@ public class FragmentCompose extends FragmentBase {
sb.append("</p>\n");
}
boolean quote_reply = prefs.getBoolean("quote_reply", true);
boolean quote = (quote_reply && ("reply".equals(action) || "reply_all".equals(action)));
if (quote)
sb.append("<blockquote>");
sb.append(refText);
if (quote)
sb.append("</blockquote>");
Helper.writeText(data.draft.getRefFile(context), sb.toString());
}

View File

@@ -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));