mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-03 12:37:31 +01:00
Review: Added optional to stage and renamed to "InteractiveAuthenticationFlow"
This commit is contained in:
parent
d353e9314b
commit
8f6f72ca48
@ -20,14 +20,14 @@ import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* A Login flow.
|
||||
* An interactive authentication flow.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class LoginFlow(
|
||||
internal data class InteractiveAuthenticationFlow(
|
||||
|
||||
@Json(name = "type")
|
||||
val type: String? = null,
|
||||
|
||||
@Json(name = "stages")
|
||||
val stages: List<String>
|
||||
val stages: List<String>? = null
|
||||
)
|
@ -16,7 +16,11 @@
|
||||
|
||||
package im.vector.matrix.android.internal.auth.data
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class LoginFlowResponse(val flows: List<LoginFlow>)
|
||||
internal data class LoginFlowResponse(
|
||||
@Json(name = "flows")
|
||||
val flows: List<InteractiveAuthenticationFlow>
|
||||
)
|
@ -19,16 +19,16 @@ package im.vector.matrix.android.internal.auth.registration
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import im.vector.matrix.android.api.util.JsonDict
|
||||
import im.vector.matrix.android.internal.auth.data.LoginFlow
|
||||
import im.vector.matrix.android.internal.auth.data.InteractiveAuthenticationFlow
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class RegistrationFlowResponse(
|
||||
|
||||
/**
|
||||
* The list of stages the client has completed successfully.
|
||||
* The list of flows.
|
||||
*/
|
||||
@Json(name = "flows")
|
||||
var loginFlows: List<LoginFlow>? = null,
|
||||
var flows: List<InteractiveAuthenticationFlow>? = null,
|
||||
|
||||
/**
|
||||
* The list of stages the client has completed successfully.
|
||||
|
@ -58,12 +58,12 @@ internal class DefaultDeleteDeviceTask(private val cryptoApi: CryptoApi,
|
||||
}
|
||||
|
||||
// check if the server response can be casted
|
||||
if (registrationFlowResponse?.loginFlows?.isNotEmpty() == true) {
|
||||
if (registrationFlowResponse?.flows?.isNotEmpty() == true) {
|
||||
val stages = ArrayList<String>()
|
||||
|
||||
// Get all stages
|
||||
registrationFlowResponse.loginFlows?.forEach {
|
||||
stages.addAll(it.stages)
|
||||
registrationFlowResponse.flows?.forEach {
|
||||
stages.addAll(it.stages ?: emptyList())
|
||||
}
|
||||
|
||||
Timber.v("## deleteDevice() : supported stages $stages")
|
||||
|
Loading…
x
Reference in New Issue
Block a user