File tree Expand file tree Collapse file tree 3 files changed +3
-8
lines changed
features/login/impl/src/main/kotlin/io/element/android/features/login/impl
screens/confirmaccountprovider Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 1+ Let the SDK figure the best scheme given an homeserver URL (thus allowing HTTP homeservers)
Original file line number Diff line number Diff line change @@ -27,11 +27,9 @@ import io.element.android.features.login.impl.error.ChangeServerError
2727import io.element.android.libraries.architecture.Async
2828import io.element.android.libraries.architecture.Presenter
2929import io.element.android.libraries.architecture.runCatchingUpdatingState
30- import io.element.android.libraries.core.data.tryOrNull
3130import io.element.android.libraries.matrix.api.auth.MatrixAuthenticationService
3231import kotlinx.coroutines.CoroutineScope
3332import kotlinx.coroutines.launch
34- import java.net.URL
3533import javax.inject.Inject
3634
3735class ChangeServerPresenter @Inject constructor(
@@ -65,8 +63,7 @@ class ChangeServerPresenter @Inject constructor(
6563 changeServerAction : MutableState <Async <Unit >>,
6664 ) = launch {
6765 suspend {
68- val domain = tryOrNull { URL (data.title) }?.host ? : data.title
69- authenticationService.setHomeserver(domain).map {
66+ authenticationService.setHomeserver(data.title).map {
7067 authenticationService.getHomeserverDetails().value!!
7168 // Valid, remember user choice
7269 accountProviderDataSource.userSelection(data)
Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ import io.element.android.features.login.impl.oidc.customtab.DefaultOidcActionFl
3535import io.element.android.libraries.architecture.Async
3636import io.element.android.libraries.architecture.Presenter
3737import io.element.android.libraries.architecture.runCatchingUpdatingState
38- import io.element.android.libraries.core.data.tryOrNull
3938import io.element.android.libraries.matrix.api.auth.MatrixAuthenticationService
4039import kotlinx.coroutines.CoroutineScope
4140import kotlinx.coroutines.launch
42- import java.net.URL
4341
4442class ConfirmAccountProviderPresenter @AssistedInject constructor(
4543 @Assisted private val params : Params ,
@@ -97,8 +95,7 @@ class ConfirmAccountProviderPresenter @AssistedInject constructor(
9795 loginFlowAction : MutableState <Async <LoginFlow >>,
9896 ) = launch {
9997 suspend {
100- val domain = tryOrNull { URL (homeserverUrl) }?.host ? : homeserverUrl
101- authenticationService.setHomeserver(domain).map {
98+ authenticationService.setHomeserver(homeserverUrl).map {
10299 val matrixHomeServerDetails = authenticationService.getHomeserverDetails().value!!
103100 if (matrixHomeServerDetails.supportsOidcLogin) {
104101 // Retrieve the details right now
You can’t perform that action at this time.
0 commit comments