mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Using /register/available also fixes #1410
(See https://github.com/matrix-org/synapse/pull/7625)
This commit is contained in:
parent
c09f7e0d7d
commit
b3ac1a1e8b
5 changed files with 1 additions and 27 deletions
|
@ -6,7 +6,7 @@ Features ✨:
|
|||
|
||||
Improvements 🙌:
|
||||
- Add ability to install APK from directly from Element (#2381)
|
||||
- Improve login/register flow (#2585, #3172)
|
||||
- Improve login/register flow (#1410, #2585, #3172)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Message states cosmetic changes (#3007)
|
||||
|
|
|
@ -42,10 +42,6 @@ import javax.inject.Inject
|
|||
*/
|
||||
class LoginFragmentSignupUsername2 @Inject constructor() : AbstractSSOLoginFragment2<FragmentLoginSignupUsername2Binding>() {
|
||||
|
||||
// Temporary patch for https://github.com/vector-im/riotX-android/issues/1410,
|
||||
// waiting for https://github.com/matrix-org/synapse/issues/7576
|
||||
private var isNumericOnlyUserIdForbidden = false
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSignupUsername2Binding {
|
||||
return FragmentLoginSignupUsername2Binding.inflate(inflater, container, false)
|
||||
}
|
||||
|
@ -79,10 +75,6 @@ class LoginFragmentSignupUsername2 @Inject constructor() : AbstractSSOLoginFragm
|
|||
views.loginFieldTil.error = getString(R.string.error_empty_field_choose_user_name)
|
||||
error++
|
||||
}
|
||||
if (isNumericOnlyUserIdForbidden && login.isDigitsOnly()) {
|
||||
views.loginFieldTil.error = "The homeserver does not accept username with only digits."
|
||||
error++
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
loginViewModel.handle(LoginAction2.SetUserName(login))
|
||||
|
@ -138,8 +130,6 @@ class LoginFragmentSignupUsername2 @Inject constructor() : AbstractSSOLoginFragm
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun updateWithState(state: LoginViewState2) {
|
||||
isNumericOnlyUserIdForbidden = state.isNumericOnlyUserIdForbidden
|
||||
|
||||
setupUi(state)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,10 +51,6 @@ class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2<Frag
|
|||
|
||||
private var passwordShown = false
|
||||
|
||||
// Temporary patch for https://github.com/vector-im/riotX-android/issues/1410,
|
||||
// waiting for https://github.com/matrix-org/synapse/issues/7576
|
||||
private var isNumericOnlyUserIdForbidden = false
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSigninToAny2Binding {
|
||||
return FragmentLoginSigninToAny2Binding.inflate(inflater, container, false)
|
||||
}
|
||||
|
@ -104,10 +100,6 @@ class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2<Frag
|
|||
views.loginFieldTil.error = getString(R.string.error_empty_field_enter_user_name)
|
||||
error++
|
||||
}
|
||||
if (isNumericOnlyUserIdForbidden && login.isDigitsOnly()) {
|
||||
views.loginFieldTil.error = "The homeserver does not accept username with only digits."
|
||||
error++
|
||||
}
|
||||
if (password.isEmpty()) {
|
||||
views.passwordFieldTil.error = getString(R.string.error_empty_field_your_password)
|
||||
error++
|
||||
|
@ -213,8 +205,6 @@ class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2<Frag
|
|||
}
|
||||
|
||||
override fun updateWithState(state: LoginViewState2) {
|
||||
isNumericOnlyUserIdForbidden = state.isNumericOnlyUserIdForbidden
|
||||
|
||||
setupUi(state)
|
||||
|
||||
if (state.isLoading) {
|
||||
|
|
|
@ -224,7 +224,6 @@ class LoginViewModel2 @AssistedInject constructor(
|
|||
loginMode = LoginMode.Sso(action.ssoIdentityProviders),
|
||||
homeServerUrlFromUser = action.homeServerUrl,
|
||||
homeServerUrl = action.homeServerUrl,
|
||||
isNumericOnlyUserIdForbidden = action.homeServerUrl == matrixOrgUrl,
|
||||
deviceId = action.deviceId
|
||||
)
|
||||
}
|
||||
|
@ -662,7 +661,6 @@ class LoginViewModel2 @AssistedInject constructor(
|
|||
isLoading = false,
|
||||
homeServerUrlFromUser = urlFromUser,
|
||||
homeServerUrl = data.homeServerUrl,
|
||||
isNumericOnlyUserIdForbidden = urlFromUser == matrixOrgUrl,
|
||||
loginMode = loginMode
|
||||
)
|
||||
}
|
||||
|
@ -818,7 +816,6 @@ class LoginViewModel2 @AssistedInject constructor(
|
|||
isLoading = false,
|
||||
homeServerUrlFromUser = homeServerConnectionConfig.homeServerUri.toString(),
|
||||
homeServerUrl = data.homeServerUrl,
|
||||
isNumericOnlyUserIdForbidden = homeServerConnectionConfig.homeServerUri.toString() == matrixOrgUrl,
|
||||
loginMode = loginMode
|
||||
)
|
||||
}
|
||||
|
|
|
@ -49,9 +49,6 @@ data class LoginViewState2(
|
|||
// Network result
|
||||
val loginProfileInfo: Async<LoginProfileInfo> = Uninitialized,
|
||||
|
||||
// True on Matrix.org
|
||||
val isNumericOnlyUserIdForbidden: Boolean = false,
|
||||
|
||||
// Network result
|
||||
@PersistState
|
||||
val loginMode: LoginMode = LoginMode.Unknown,
|
||||
|
|
Loading…
Reference in a new issue