Update regarding SDK change on verification data
This commit is contained in:
parent
049eb1de07
commit
5001a6fbe1
8 changed files with 105 additions and 48 deletions
|
|
@ -16,7 +16,24 @@
|
|||
|
||||
package io.element.android.libraries.matrix.api.verification
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
|
||||
@Immutable
|
||||
sealed interface SessionVerificationData {
|
||||
data class Emojis(
|
||||
// 7 emojis
|
||||
val emojis: List<VerificationEmoji>,
|
||||
) : SessionVerificationData
|
||||
|
||||
data class Decimals(
|
||||
// 3 numbers
|
||||
val decimals: List<Int>,
|
||||
) : SessionVerificationData
|
||||
}
|
||||
|
||||
// https://spec.matrix.org/unstable/client-server-api/#sas-method-emoji
|
||||
data class VerificationEmoji(
|
||||
val code: Int,
|
||||
val name: String,
|
||||
val number: Int,
|
||||
val emoji: String,
|
||||
val description: String,
|
||||
)
|
||||
|
|
@ -101,8 +101,8 @@ sealed interface VerificationFlowState {
|
|||
/** Short Authentication String (SAS) verification started between the 2 devices. */
|
||||
data object StartedSasVerification : VerificationFlowState
|
||||
|
||||
/** Verification data for the SAS verification (emojis) received. */
|
||||
data class ReceivedVerificationData(val emoji: ImmutableList<VerificationEmoji>) : VerificationFlowState
|
||||
/** Verification data for the SAS verification received. */
|
||||
data class ReceivedVerificationData(val data: SessionVerificationData) : VerificationFlowState
|
||||
|
||||
/** Verification completed successfully. */
|
||||
data object Finished : VerificationFlowState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue