diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index 8ecd76539c..bb5867e316 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -234,6 +234,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private EditText etNativeArcWhitelist;
private SwitchCompat swInfra;
private SwitchCompat swDupMsgId;
+ private SwitchCompat swThreadByRef;
private EditText etKeywords;
private SwitchCompat swTestIab;
private Button btnImportProviders;
@@ -296,7 +297,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"max_backoff_power", "logarithmic_backoff",
"exact_alarms",
"native_dkim", "native_arc", "native_arc_whitelist",
- "infra", "dup_msgids", "global_keywords", "test_iab"
+ "infra", "dup_msgids", "thread_byref", "global_keywords", "test_iab"
};
private final static String[] RESET_QUESTIONS = new String[]{
@@ -478,6 +479,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
etNativeArcWhitelist = view.findViewById(R.id.etNativeArcWhitelist);
swInfra = view.findViewById(R.id.swInfra);
swDupMsgId = view.findViewById(R.id.swDupMsgId);
+ swThreadByRef = view.findViewById(R.id.swThreadByRef);
etKeywords = view.findViewById(R.id.etKeywords);
swTestIab = view.findViewById(R.id.swTestIab);
btnImportProviders = view.findViewById(R.id.btnImportProviders);
@@ -1773,6 +1775,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
+ swThreadByRef.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("thread_byref", checked).apply();
+ }
+ });
+
etKeywords.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@@ -2509,6 +2518,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
etNativeArcWhitelist.setText(prefs.getString("native_arc_whitelist", null));
swInfra.setChecked(prefs.getBoolean("infra", false));
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
+ swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true));
etKeywords.setText(prefs.getString("global_keywords", null));
swTestIab.setChecked(prefs.getBoolean("test_iab", false));
diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java
index f71fb9a734..5bed67489f 100644
--- a/app/src/main/java/eu/faircode/email/MessageHelper.java
+++ b/app/src/main/java/eu/faircode/email/MessageHelper.java
@@ -1872,7 +1872,8 @@ public class MessageHelper {
}
// Common reference
- if (thread == null && refs.size() > 0) {
+ boolean thread_byref = prefs.getBoolean("thread_byref", true);
+ if (thread == null && refs.size() > 0 && thread_byref) {
String ref = refs.get(0);
if (!Objects.equals(ref, msgid))
thread = account + ":" + ref;
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 70039093ab..747692c4cb 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -2206,6 +2206,17 @@
app:layout_constraintTop_toBottomOf="@id/tvDkimVerifyHint"
app:switchPadding="12dp" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/swThreadByRef" />
Native ARC verification
Show infrastructure
Duplicates by message ID
+ Thread by common reference
Global keywords
Test IAB
Import providers