Debug: MDN switch

pull/213/head
M66B 2 years ago
parent 0f805df677
commit 8424ac076d

@ -4277,6 +4277,7 @@ class Core {
boolean notify_known = prefs.getBoolean("notify_known", false);
boolean native_dkim = prefs.getBoolean("native_dkim", false);
boolean experiments = prefs.getBoolean("experiments", false);
boolean mdn = prefs.getBoolean("mdn", experiments);
boolean pro = ActivityBilling.isPro(context);
long uid = ifolder.getUID(imessage);
@ -4614,7 +4615,7 @@ class Core {
List<Header> headers = (needsHeaders ? helper.getAllHeaders() : null);
String body = (needsBody ? parts.getHtml(context, download_plain) : null);
if (experiments && helper.isReport())
if (mdn && helper.isReport())
try {
MessageHelper.Report r = parts.getReport();
boolean client_id = prefs.getBoolean("client_id", true);

@ -239,6 +239,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swTldFlags;
private SwitchCompat swDupMsgId;
private SwitchCompat swThreadByRef;
private SwitchCompat swMdn;
private EditText etKeywords;
private SwitchCompat swTestIab;
private Button btnImportProviders;
@ -301,7 +302,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"max_backoff_power", "logarithmic_backoff",
"exact_alarms",
"native_dkim", "native_arc", "native_arc_whitelist",
"infra", "tld_flags", "dup_msgids", "thread_byref", "global_keywords", "test_iab"
"infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "global_keywords", "test_iab"
};
private final static String[] RESET_QUESTIONS = new String[]{
@ -488,6 +489,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swTldFlags = view.findViewById(R.id.swTldFlags);
swDupMsgId = view.findViewById(R.id.swDupMsgId);
swThreadByRef = view.findViewById(R.id.swThreadByRef);
swMdn = view.findViewById(R.id.swMdn);
etKeywords = view.findViewById(R.id.etKeywords);
swTestIab = view.findViewById(R.id.swTestIab);
btnImportProviders = view.findViewById(R.id.btnImportProviders);
@ -1847,6 +1849,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swMdn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("mdn", checked).apply();
}
});
etKeywords.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -2592,6 +2601,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swTldFlags.setChecked(prefs.getBoolean("tld_flags", false));
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true));
swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked()));
etKeywords.setText(prefs.getString("global_keywords", null));
swTestIab.setChecked(prefs.getBoolean("test_iab", false));

@ -2272,6 +2272,17 @@
app:layout_constraintTop_toBottomOf="@id/swDupMsgId"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swMdn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_mdn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swThreadByRef"
app:switchPadding="12dp" />
<EditText
android:id="@+id/etKeywords"
android:layout_width="0dp"
@ -2282,7 +2293,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swThreadByRef" />
app:layout_constraintTop_toBottomOf="@id/swMdn" />
<TextView
android:id="@+id/tvKeywordsHint"

@ -899,6 +899,7 @@
<string name="title_advanced_tld_flags" translatable="false">Show TLD flags</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_mdn" translatable="false">Process MDNs</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…
Cancel
Save