From 2194d946e7bc80bf5a97d22e9c4e7790625e4f62 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 28 Jul 2024 19:01:20 +0200 Subject: [PATCH] Improved error dialog --- .../main/java/eu/faircode/email/ActivityError.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityError.java b/app/src/main/java/eu/faircode/email/ActivityError.java index a3d81c2b90..6327e8a498 100644 --- a/app/src/main/java/eu/faircode/email/ActivityError.java +++ b/app/src/main/java/eu/faircode/email/ActivityError.java @@ -109,8 +109,12 @@ public class ActivityError extends ActivityBase { ? View.VISIBLE : View.GONE); boolean password = (auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD); + boolean outlook = ("outlook.office365.com".equalsIgnoreCase(host) || + "smtp.office365.com".equalsIgnoreCase(host) || + "imap-mail.outlook.com".equalsIgnoreCase(host) || + "smtp-mail.outlook.com".equalsIgnoreCase(host)); - btnPassword.setText(password ? R.string.title_password : R.string.title_setup_oauth_authorize); + btnPassword.setText(password && !outlook ? R.string.title_password : R.string.title_setup_oauth_authorize); btnPassword.setCompoundDrawablesRelativeWithIntrinsicBounds( 0, 0, password ? R.drawable.twotone_edit_24 : R.drawable.twotone_check_24, 0); @@ -143,11 +147,12 @@ public class ActivityError extends ActivityBase { startActivity(new Intent(ActivityError.this, ActivitySetup.class) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); } - } else if (auth_type == ServiceAuthenticator.AUTH_TYPE_GRAPH) + } else if (auth_type == ServiceAuthenticator.AUTH_TYPE_GRAPH || + (auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD && outlook)) startActivity(new Intent(ActivityError.this, ActivitySetup.class) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) .putExtra("target", "oauth") - .putExtra("id", provider) + .putExtra("id", "outlookgraph") .putExtra("name", "Outlook") .putExtra("askAccount", true) .putExtra("askTenant", true)