mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
[Link new device] Handle split steps in the SDK
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright (c) 2026 Element Creations Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
* Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.libraries.matrix.api.linknewdevice
|
||||
|
||||
interface ContinuationMessageSender {
|
||||
suspend fun cancel(): Result<Unit>
|
||||
suspend fun confirm(): Result<Unit>
|
||||
}
|
||||
+2
@@ -18,8 +18,10 @@ interface LinkDesktopHandler {
|
||||
sealed interface LinkDesktopStep {
|
||||
data object Uninitialized : LinkDesktopStep
|
||||
data object Starting : LinkDesktopStep
|
||||
|
||||
data class WaitingForAuth(
|
||||
val verificationUri: String,
|
||||
val continuationMessageSender: ContinuationMessageSender,
|
||||
) : LinkDesktopStep
|
||||
|
||||
data class EstablishingSecureChannel(
|
||||
|
||||
+6
-1
@@ -22,7 +22,12 @@ sealed interface LinkMobileStep {
|
||||
data object Starting : LinkMobileStep
|
||||
data class QrReady(val data: String) : LinkMobileStep
|
||||
data object QrRotating : LinkMobileStep
|
||||
data class WaitingForAuth(val verificationUri: String) : LinkMobileStep
|
||||
|
||||
data class WaitingForAuth(
|
||||
val verificationUri: String,
|
||||
val continuationMessageSender: ContinuationMessageSender,
|
||||
) : LinkMobileStep
|
||||
|
||||
data class QrScanned(val checkCodeSender: CheckCodeSender) : LinkMobileStep
|
||||
data class Error(val errorType: ErrorType) : LinkMobileStep
|
||||
data object SyncingSecrets : LinkMobileStep
|
||||
|
||||
Reference in New Issue
Block a user