Merge pull request #3461 from element-hq/feature/fga/send_failure_identity_changes
Require acknowledgement to send to a verified user if their identity changed or if a device is unverified.
This commit is contained in:
commit
47d0c505b5
50 changed files with 1355 additions and 87 deletions
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
package io.element.android.libraries.matrix.api.room
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.DeviceId
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.ProgressCallback
|
||||
import io.element.android.libraries.matrix.api.core.RoomAlias
|
||||
|
|
@ -349,5 +350,24 @@ interface MatrixRoom : Closeable {
|
|||
*/
|
||||
suspend fun clearComposerDraft(): Result<Unit>
|
||||
|
||||
/**
|
||||
* Ignore the local trust for the given devices and resend messages that failed to send because said devices are unverified.
|
||||
*
|
||||
* @param devices The map of users identifiers to device identifiers received in the error
|
||||
* @param transactionId The send queue transaction identifier of the local echo the send error applies to.
|
||||
*
|
||||
*/
|
||||
suspend fun ignoreDeviceTrustAndResend(devices: Map<UserId, List<DeviceId>>, transactionId: TransactionId): Result<Unit>
|
||||
|
||||
/**
|
||||
* Remove verification requirements for the given users and
|
||||
* resend messages that failed to send because their identities were no longer verified.
|
||||
*
|
||||
* @param userIds The list of users identifiers received in the error.
|
||||
* @param transactionId The send queue transaction identifier of the local echo the send error applies to.
|
||||
*
|
||||
*/
|
||||
suspend fun withdrawVerificationAndResend(userIds: List<UserId>, transactionId: TransactionId): Result<Unit>
|
||||
|
||||
override fun close() = destroy()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
package io.element.android.libraries.matrix.api.timeline.item.event
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import io.element.android.libraries.matrix.api.core.DeviceId
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
|
||||
|
|
@ -18,21 +19,24 @@ sealed interface LocalEventSendState {
|
|||
data class Unknown(val error: String) : Failed
|
||||
data object CrossSigningNotSetup : Failed
|
||||
data object SendingFromUnverifiedDevice : Failed
|
||||
|
||||
sealed interface VerifiedUser : Failed
|
||||
data class VerifiedUserHasUnsignedDevice(
|
||||
/**
|
||||
* The unsigned devices belonging to verified users. A map from user ID
|
||||
* to a list of device IDs.
|
||||
*/
|
||||
val devices: Map<UserId, List<String>>
|
||||
) : Failed
|
||||
val devices: Map<UserId, List<DeviceId>>
|
||||
) : VerifiedUser
|
||||
|
||||
data class VerifiedUserChangedIdentity(
|
||||
/**
|
||||
* The users that were previously verified but are no longer.
|
||||
*/
|
||||
val users: List<UserId>
|
||||
) : Failed
|
||||
) : VerifiedUser
|
||||
}
|
||||
|
||||
data class Sent(
|
||||
val eventId: EventId
|
||||
) : LocalEventSendState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue