mirror of https://github.com/M66B/FairEmail.git
Debug: option to disable threading by common reference
This commit is contained in:
parent
e68116c301
commit
051d687a18
|
@ -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));
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -2206,6 +2206,17 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/tvDkimVerifyHint"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swThreadByRef"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_thread_by_ref"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDupMsgId"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etKeywords"
|
||||
android:layout_width="0dp"
|
||||
|
@ -2216,7 +2227,7 @@
|
|||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDupMsgId" />
|
||||
app:layout_constraintTop_toBottomOf="@id/swThreadByRef" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvKeywordsHint"
|
||||
|
|
|
@ -881,6 +881,7 @@
|
|||
<string name="title_advanced_native_arc" translatable="false">Native ARC verification</string>
|
||||
<string name="title_advanced_infra" translatable="false">Show infrastructure</string>
|
||||
<string name="title_advanced_dup_msgid" translatable="false">Duplicates by message ID</string>
|
||||
<string name="title_advanced_thread_by_ref" translatable="false">Thread by common reference</string>
|
||||
<string name="title_advanced_global_keywords" translatable="false">Global keywords</string>
|
||||
<string name="title_advanced_test_iab" translatable="false">Test IAB</string>
|
||||
<string name="title_advanced_import_providers" translatable="false">Import providers</string>
|
||||
|
|
Loading…
Reference in New Issue