mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Merge pull request #1965 from vector-im/feature/bma/emojiRepresentation
Fix emoji representation
This commit is contained in:
+19
-2
@@ -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: String,
|
||||
val name: String,
|
||||
val number: Int,
|
||||
val emoji: String,
|
||||
val description: String,
|
||||
)
|
||||
+3
-4
@@ -17,7 +17,6 @@
|
||||
package io.element.android.libraries.matrix.api.verification
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
@@ -26,7 +25,7 @@ interface SessionVerificationService {
|
||||
/**
|
||||
* State of the current verification flow ([VerificationFlowState.Initial] if not started).
|
||||
*/
|
||||
val verificationFlowState : StateFlow<VerificationFlowState>
|
||||
val verificationFlowState: StateFlow<VerificationFlowState>
|
||||
|
||||
/**
|
||||
* The internal service that checks verification can only run after the initial sync.
|
||||
@@ -101,8 +100,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
|
||||
|
||||
Reference in New Issue
Block a user