diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java b/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java
index 20eb46fba1..934b546cf6 100644
--- a/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java
+++ b/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java
@@ -114,6 +114,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
final Context context = getContext();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean sanitize_links = prefs.getBoolean("sanitize_links", false);
boolean check_links_dbl = prefs.getBoolean("check_links_dbl", BuildConfig.PLAY_STORE_RELEASE);
boolean disconnect_links = prefs.getBoolean("disconnect_links", true);
@@ -575,6 +576,8 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
tvDisconnectCategories.setVisibility(
categories == null || !BuildConfig.DEBUG ? View.GONE : View.VISIBLE);
+ cbSanitize.setChecked(sanitize_links);
+
cbNotAgain.setText(context.getString(R.string.title_no_ask_for_again, uri.getHost()));
cbNotAgain.setVisibility(
UriHelper.isSecure(uri) && !TextUtils.isEmpty(uri.getHost())
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
index b3d10838ea..5c85252cd5 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java
@@ -66,6 +66,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private View view;
private ImageButton ibHelp;
private SwitchCompat swConfirmLinks;
+ private SwitchCompat swSanitizeLinks;
private SwitchCompat swCheckLinksDbl;
private SwitchCompat swConfirmImages;
private SwitchCompat swAskImages;
@@ -107,7 +108,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private final static int BIP39_WORDS = 6;
private final static String[] RESET_OPTIONS = new String[]{
- "confirm_links", "check_links_dbl",
+ "confirm_links", "sanitize_links", "check_links_dbl",
"confirm_images", "ask_images", "html_always_images", "confirm_html", "ask_html",
"disable_tracking",
"pin", "biometrics", "biometrics_timeout", "autolock", "autolock_nav",
@@ -130,6 +131,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
ibHelp = view.findViewById(R.id.ibHelp);
swConfirmLinks = view.findViewById(R.id.swConfirmLinks);
+ swSanitizeLinks = view.findViewById(R.id.swSanitizeLinks);
swCheckLinksDbl = view.findViewById(R.id.swCheckLinksDbl);
swConfirmImages = view.findViewById(R.id.swConfirmImages);
swAskImages = view.findViewById(R.id.swAskImages);
@@ -191,10 +193,18 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
if (key.endsWith(".confirm_link"))
editor.remove(key);
editor.apply();
+ swSanitizeLinks.setEnabled(checked);
swCheckLinksDbl.setEnabled(checked);
}
});
+ swSanitizeLinks.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("sanitize_links", checked).apply();
+ }
+ });
+
swCheckLinksDbl.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -554,6 +564,8 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
swConfirmLinks.setChecked(prefs.getBoolean("confirm_links", true));
+ swSanitizeLinks.setChecked(prefs.getBoolean("sanitize_links", false));
+ swSanitizeLinks.setEnabled(swConfirmLinks.isChecked());
swCheckLinksDbl.setChecked(prefs.getBoolean("check_links_dbl", BuildConfig.PLAY_STORE_RELEASE));
swCheckLinksDbl.setEnabled(swConfirmLinks.isChecked());
swConfirmImages.setChecked(prefs.getBoolean("confirm_images", true));
diff --git a/app/src/main/res/layout/fragment_options_privacy.xml b/app/src/main/res/layout/fragment_options_privacy.xml
index 6919617009..bb45ca5edf 100644
--- a/app/src/main/res/layout/fragment_options_privacy.xml
+++ b/app/src/main/res/layout/fragment_options_privacy.xml
@@ -100,6 +100,32 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swConfirmLinks" />
+
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0fd0298248..44d3b7ef44 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -684,6 +684,8 @@
S/MIME
Confirm opening links
+ Remove tracking parameters by default
+ Only when confirming links
Check domain block lists for suspicious links
Show no images by default
Confirm showing images