mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
renaming sdk model to matrix
This commit is contained in:
parent
8136f57b5e
commit
a4b5d1819d
@ -24,7 +24,7 @@ import org.matrix.android.sdk.api.auth.registration.RegistrationWizard
|
||||
import org.matrix.android.sdk.api.failure.is401
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import javax.inject.Inject
|
||||
import org.matrix.android.sdk.api.auth.registration.RegistrationResult as SdkRegistrationResult
|
||||
import org.matrix.android.sdk.api.auth.registration.RegistrationResult as MatrixRegistrationResult
|
||||
|
||||
class RegistrationActionHandler @Inject constructor() {
|
||||
|
||||
@ -73,14 +73,14 @@ class RegistrationActionHandler @Inject constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun resultOf(block: () -> SdkRegistrationResult): RegistrationResult {
|
||||
private inline fun resultOf(block: () -> MatrixRegistrationResult): RegistrationResult {
|
||||
return runCatching { block() }.fold(
|
||||
onSuccess = { it.toRegistrationResult() },
|
||||
onFailure = { RegistrationResult.Error(it) }
|
||||
)
|
||||
}
|
||||
|
||||
private fun SdkRegistrationResult.toRegistrationResult() = when (this) {
|
||||
private fun MatrixRegistrationResult.toRegistrationResult() = when (this) {
|
||||
is FlowResponse -> RegistrationResult.NextStep(flowResult)
|
||||
is Success -> RegistrationResult.Complete(session)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user