diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index 71188003f3..53113b2bd7 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -223,6 +223,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SeekBar sbMaxBackOff;
private SwitchCompat swLogarithmicBackoff;
private SwitchCompat swExactAlarms;
+ private SwitchCompat swServerAlerts;
private SwitchCompat swNativeDkim;
private SwitchCompat swNativeArc;
private EditText etNativeArcWhitelist;
@@ -312,7 +313,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"imap_compress", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
"max_backoff_power", "logarithmic_backoff",
- "exact_alarms",
+ "exact_alarms", "server_alerts",
"native_dkim", "native_arc", "native_arc_whitelist", "strict_alignment",
"svg", "webp", "animate_images",
"preview_hidden", "preview_quotes",
@@ -497,6 +498,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
sbMaxBackOff = view.findViewById(R.id.sbMaxBackOff);
swLogarithmicBackoff = view.findViewById(R.id.swLogarithmicBackoff);
swExactAlarms = view.findViewById(R.id.swExactAlarms);
+ swServerAlerts = view.findViewById(R.id.swServerAlerts);
swNativeDkim = view.findViewById(R.id.swNativeDkim);
swNativeArc = view.findViewById(R.id.swNativeArc);
etNativeArcWhitelist = view.findViewById(R.id.etNativeArcWhitelist);
@@ -1651,6 +1653,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
+ swServerAlerts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("server_alerts", checked).apply();
+ }
+ });
+
swNativeDkim.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -2651,6 +2660,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swLogarithmicBackoff.setChecked(prefs.getBoolean("logarithmic_backoff", true));
swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true));
+ swServerAlerts.setChecked(prefs.getBoolean("server_alerts", !Helper.isPlayStoreInstall()));
swNativeDkim.setEnabled(!BuildConfig.PLAY_STORE_RELEASE || true);
swNativeDkim.setChecked(prefs.getBoolean("native_dkim", false));
swNativeArc.setEnabled(swNativeDkim.isEnabled() && swNativeDkim.isChecked());
diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java
index 98c23e56ed..08e2520b94 100644
--- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java
+++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java
@@ -1717,7 +1717,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Account, account,
account.name + " alert: " + message);
- if (!ConnectionHelper.isMaxConnections(message))
+ if (!ConnectionHelper.isMaxConnections(message) &&
+ prefs.getBoolean("server_alerts", !Helper.isPlayStoreInstall()))
try {
NotificationManager nm =
Helper.getSystemService(ServiceSynchronize.this, NotificationManager.class);
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index a68dbc792a..2e8004fb05 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -1680,6 +1680,17 @@
app:layout_constraintTop_toBottomOf="@id/tvLogarithmicBackoffHint"
app:switchPadding="12dp" />
+
+
Poll on keep-alive
Empty connection pool
Use exact timers
+ Server alerts
Native DKIM verification
Native ARC verification
Strict alignment