From db818a57cbb42caaeb537504a27660b3f2f8d1cc Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Wed, 27 Apr 2022 12:38:18 +0530 Subject: [PATCH] AccountManager: Hardcode sync url for e.email --- app/src/main/java/foundation/e/accountmanager/Constants.kt | 1 + .../e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/foundation/e/accountmanager/Constants.kt b/app/src/main/java/foundation/e/accountmanager/Constants.kt index 5619fde74..28d08cc4f 100644 --- a/app/src/main/java/foundation/e/accountmanager/Constants.kt +++ b/app/src/main/java/foundation/e/accountmanager/Constants.kt @@ -33,5 +33,6 @@ object Constants { const val EELO_SYNC_SCHEME = "https://" const val EELO_SYNC_HOST = "ecloud.global" + const val E_SYNC_URL = EELO_SYNC_SCHEME + "e.email" const val EELO_SYNC_URL = EELO_SYNC_SCHEME + EELO_SYNC_HOST } diff --git a/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt b/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt index 4217d5281..dcb6972e1 100644 --- a/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt +++ b/app/src/main/java/foundation/e/accountmanager/ui/setup/EeloAuthenticatorFragment.kt @@ -9,6 +9,7 @@ import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProviders +import foundation.e.accountmanager.Constants import foundation.e.accountmanager.ECloudAccountHelper import foundation.e.accountmanager.R import foundation.e.accountmanager.databinding.FragmentEeloAuthenticatorBinding @@ -114,7 +115,11 @@ class EeloAuthenticatorFragment : Fragment() { private fun validate(): Boolean { var valid = false - var serverUrl = requireView().urlpwd_server_uri.text.toString(); + var serverUrl = requireView().urlpwd_server_uri.text.toString() + + if (serverUrl == Constants.E_SYNC_URL) { + serverUrl = Constants.EELO_SYNC_URL + } fun validateUrl() { -- GitLab