From 4a51f866e6f8b261c7a2b4e413c94f67db0cc6cd Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 12 May 2022 08:07:15 +0200 Subject: [PATCH] Exclude Live and Hotmail accounts for Outlook check --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 6 +++++- .../main/java/eu/faircode/email/FragmentOptionsMisc.java | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index cf0ec17c8e..4075647b78 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4858,11 +4858,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. int passwd = 0; if (accounts != null) for (EntityAccount account : accounts) - if (account.isOutlook()) + if (account.isOutlook()) { + String user = (account.user == null ? "" : account.user.toLowerCase(Locale.ROOT)); + if (user.contains("@hotmail") || user.contains("@live")) + continue; if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_OAUTH) oauth++; else if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD) passwd++; + } if (oauth + passwd == 0) { prefs.edit().putBoolean("outlook_checked", true).apply(); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 10d50374a4..b684be24ba 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -1613,6 +1613,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc editor.remove(key); } + if (BuildConfig.DEBUG) { + editor.remove("gmail_checked"); + editor.remove("outlook_checked"); + } + editor.apply(); ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show();