Loading app/src/main/java/at/bitfire/davdroid/ui/setup/EeloAuthenticatorFragment.kt +17 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,21 @@ class EeloAuthenticatorFragment : Fragment() { super.onSaveInstanceState(outState) } /** * murena.io account can have userName which is not email address * But, we want to have email as userName so that auth to services like Mail doesn't break. * This method check the provided userName if it is not email & server is https://murena.io; * then add `@murena.io` after the userName to make full email address. */ @SuppressLint("SetTextI18n") private fun purifyUserName(serverUrl: String) { val providedUserName = requireView().urlpwd_user_name.text.toString() if (!providedUserName.contains("@") && serverUrl == "https://${Constants.EELO_SYNC_HOST}") { requireView().urlpwd_user_name.setText("$providedUserName@${Constants.EELO_SYNC_HOST}") } } private fun computeDomain(username: CharSequence?) : String { var domain = "https://${Constants.EELO_SYNC_HOST}" Loading Loading @@ -198,6 +213,8 @@ class EeloAuthenticatorFragment : Fragment() { addSupportRetryOn401IfPossible(serverUrl) } purifyUserName(serverUrl) fun validateUrl() { model.baseUrlError.value = null Loading Loading
app/src/main/java/at/bitfire/davdroid/ui/setup/EeloAuthenticatorFragment.kt +17 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,21 @@ class EeloAuthenticatorFragment : Fragment() { super.onSaveInstanceState(outState) } /** * murena.io account can have userName which is not email address * But, we want to have email as userName so that auth to services like Mail doesn't break. * This method check the provided userName if it is not email & server is https://murena.io; * then add `@murena.io` after the userName to make full email address. */ @SuppressLint("SetTextI18n") private fun purifyUserName(serverUrl: String) { val providedUserName = requireView().urlpwd_user_name.text.toString() if (!providedUserName.contains("@") && serverUrl == "https://${Constants.EELO_SYNC_HOST}") { requireView().urlpwd_user_name.setText("$providedUserName@${Constants.EELO_SYNC_HOST}") } } private fun computeDomain(username: CharSequence?) : String { var domain = "https://${Constants.EELO_SYNC_HOST}" Loading Loading @@ -198,6 +213,8 @@ class EeloAuthenticatorFragment : Fragment() { addSupportRetryOn401IfPossible(serverUrl) } purifyUserName(serverUrl) fun validateUrl() { model.baseUrlError.value = null Loading