Bump rust-sdk version to rust-sdk 0.2.57 (#3735)
* Bump rust-sdk version to rust-sdk 0.2.57 * rust sdk update: Support persisted WedgeQueueError * Trust & Decoration | Support new expected UTD causes * Room Subscribtion settings not needed anymore (see https://github.com/matrix-org/matrix-rust-sdk/pull/4159) * File/Attachement upload: update to support `storeInCache` * feat(knock): update API to use reason and serverNames * Add another `Konsist` exception * Update screenshots --------- Co-authored-by: Jorge Martín <jorgem@element.io> Co-authored-by: ElementBot <android@element.io> Co-authored-by: Benoit Marty <benoit@matrix.org>
This commit is contained in:
parent
f44c8dd452
commit
9fb68fc58e
23 changed files with 223 additions and 58 deletions
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright 2024 New Vector Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
* Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
package io.element.android.features.messages.impl.timeline.components
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.runtime.Composable
|
||||
import io.element.android.features.messages.impl.timeline.aTimelineItemEvent
|
||||
import io.element.android.features.messages.impl.timeline.aTimelineItemReactions
|
||||
import io.element.android.features.messages.impl.timeline.model.TimelineItemGroupPosition
|
||||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemEncryptedContent
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.UnableToDecryptContent
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.UtdCause
|
||||
|
||||
@PreviewsDayNight
|
||||
@Composable
|
||||
internal fun TimelineItemEventRowUtdPreview() = ElementPreview {
|
||||
Column {
|
||||
ATimelineItemEventRow(
|
||||
event = aTimelineItemEvent(
|
||||
senderDisplayName = "Alice",
|
||||
isMine = false,
|
||||
content = TimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.UnsignedDevice,
|
||||
)
|
||||
),
|
||||
timelineItemReactions = aTimelineItemReactions(count = 0),
|
||||
groupPosition = TimelineItemGroupPosition.First,
|
||||
),
|
||||
)
|
||||
ATimelineItemEventRow(
|
||||
event = aTimelineItemEvent(
|
||||
senderDisplayName = "Bob",
|
||||
isMine = false,
|
||||
content = TimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.VerificationViolation,
|
||||
)
|
||||
),
|
||||
groupPosition = TimelineItemGroupPosition.First,
|
||||
timelineItemReactions = aTimelineItemReactions(count = 0)
|
||||
),
|
||||
)
|
||||
|
||||
ATimelineItemEventRow(
|
||||
event = aTimelineItemEvent(
|
||||
senderDisplayName = "Bob",
|
||||
isMine = false,
|
||||
content = TimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.SentBeforeWeJoined,
|
||||
)
|
||||
),
|
||||
groupPosition = TimelineItemGroupPosition.Last,
|
||||
timelineItemReactions = aTimelineItemReactions(count = 0)
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -27,11 +27,28 @@ fun TimelineItemEncryptedView(
|
|||
onContentLayoutChange: (ContentAvoidingLayoutData) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val isMembershipUtd = (content.data as? UnableToDecryptContent.Data.MegolmV1AesSha2)?.utdCause == UtdCause.Membership
|
||||
val (textId, iconId) = if (isMembershipUtd) {
|
||||
CommonStrings.common_unable_to_decrypt_no_access to CompoundDrawables.ic_compound_block
|
||||
} else {
|
||||
CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time
|
||||
val (textId, iconId) = when (content.data) {
|
||||
is UnableToDecryptContent.Data.MegolmV1AesSha2 -> {
|
||||
when (content.data.utdCause) {
|
||||
UtdCause.SentBeforeWeJoined -> {
|
||||
CommonStrings.common_unable_to_decrypt_no_access to CompoundDrawables.ic_compound_block
|
||||
}
|
||||
UtdCause.VerificationViolation -> {
|
||||
CommonStrings.common_unable_to_decrypt_verification_violation to CompoundDrawables.ic_compound_block
|
||||
}
|
||||
UtdCause.UnsignedDevice,
|
||||
UtdCause.UnknownDevice -> {
|
||||
CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block
|
||||
}
|
||||
else -> {
|
||||
CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
// Should not happen, we only supports megolm in rooms
|
||||
CommonStrings.common_waiting_for_decryption_key to CompoundDrawables.ic_compound_time
|
||||
}
|
||||
}
|
||||
TimelineItemInformativeView(
|
||||
text = stringResource(id = textId),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,19 @@ open class TimelineItemEncryptedContentProvider : PreviewParameterProvider<Timel
|
|||
aTimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.Membership,
|
||||
utdCause = UtdCause.SentBeforeWeJoined,
|
||||
)
|
||||
),
|
||||
aTimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.VerificationViolation,
|
||||
)
|
||||
),
|
||||
aTimelineItemEncryptedContent(
|
||||
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
|
||||
sessionId = "sessionId",
|
||||
utdCause = UtdCause.UnsignedDevice,
|
||||
)
|
||||
),
|
||||
aTimelineItemEncryptedContent(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue