mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 23:43:07 +00:00
Added setting to enable removing of signatures
This commit is contained in:
parent
bddcb11305
commit
32ece5079f
4 changed files with 26 additions and 4 deletions
|
@ -3065,8 +3065,8 @@ public class FragmentCompose extends FragmentBase {
|
|||
Document d = JsoupEx.parse(Helper.readText(ref.getFile(context)));
|
||||
|
||||
// Remove signature separators
|
||||
boolean usenet = prefs.getBoolean("usenet_signature", false);
|
||||
if (usenet)
|
||||
boolean remove_signatures = prefs.getBoolean("remove_signatures", false);
|
||||
if (remove_signatures)
|
||||
d.body().filter(new NodeFilter() {
|
||||
private boolean remove = false;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
private SwitchCompat swPlainOnly;
|
||||
private SwitchCompat swSignatureEnd;
|
||||
private SwitchCompat swUsenetSignature;
|
||||
private SwitchCompat swRemoveSignatures;
|
||||
private SwitchCompat swResizeImages;
|
||||
private SwitchCompat swResizeAttachments;
|
||||
private Spinner spAutoResize;
|
||||
|
@ -65,7 +66,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"keyboard", "suggest_sent", "suggested_received",
|
||||
"prefix_once", "extended_reply", "quote_reply", "signature_end",
|
||||
"plain_only", "usenet_signature",
|
||||
"plain_only", "usenet_signature", "remove_signatures",
|
||||
"resize_images", "resize_attachments", "send_reminders", "receipt_default", "resize", "lookup_mx", "send_delayed"
|
||||
};
|
||||
|
||||
|
@ -89,6 +90,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
swPlainOnly = view.findViewById(R.id.swPlainOnly);
|
||||
swSignatureEnd = view.findViewById(R.id.swSignatureEnd);
|
||||
swUsenetSignature = view.findViewById(R.id.swUsenetSignature);
|
||||
swRemoveSignatures = view.findViewById(R.id.swRemoveSignatures);
|
||||
swResizeImages = view.findViewById(R.id.swResizeImages);
|
||||
swResizeAttachments = view.findViewById(R.id.swResizeAttachments);
|
||||
spAutoResize = view.findViewById(R.id.spAutoResize);
|
||||
|
@ -175,6 +177,13 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
}
|
||||
});
|
||||
|
||||
swRemoveSignatures.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("remove_signatures", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swResizeImages.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
@ -294,6 +303,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
swPlainOnly.setChecked(prefs.getBoolean("plain_only", false));
|
||||
swSignatureEnd.setChecked(prefs.getBoolean("signature_end", false));
|
||||
swUsenetSignature.setChecked(prefs.getBoolean("usenet_signature", false));
|
||||
swRemoveSignatures.setChecked(prefs.getBoolean("remove_signatures", false));
|
||||
|
||||
swResizeImages.setChecked(prefs.getBoolean("resize_images", true));
|
||||
swResizeAttachments.setChecked(prefs.getBoolean("resize_attachments", true));
|
||||
|
|
|
@ -164,6 +164,17 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swUsenetSignature" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swRemoveSignatures"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_remove_signatures"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUsenetSignatureHint"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swResizeImages"
|
||||
android:layout_width="0dp"
|
||||
|
@ -173,7 +184,7 @@
|
|||
android:text="@string/title_advanced_resize_images"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUsenetSignatureHint"
|
||||
app:layout_constraintTop_toBottomOf="@id/swRemoveSignatures"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
|
|
@ -272,6 +272,7 @@
|
|||
<string name="title_advanced_signature_end">Add signature after quoted/forwarded message</string>
|
||||
<string name="title_advanced_plain_only">Send plain text only by default</string>
|
||||
<string name="title_advanced_usenet_signature">Usenet signature convention</string>
|
||||
<string name="title_advanced_remove_signatures">Remove recognized signatures</string>
|
||||
<string name="title_advanced_resize_images">Automatically resize embedded images</string>
|
||||
<string name="title_advanced_resize_attachments">Automatically resize image attachments</string>
|
||||
<string name="title_advanced_resize_pixels">< %1$d pixels</string>
|
||||
|
|
Loading…
Reference in a new issue