Skip to content

Commit ae03c4c

Browse files
committed
deps(sdk) : update rust sdk to 0.2.72 and fix api breaks
2 parents d9a7e13 + abc8a14 commit ae03c4c

File tree

9 files changed

+30
-8
lines changed

9 files changed

+30
-8
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemEncryptedView.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ fun TimelineItemEncryptedView(
4040
UtdCause.UnknownDevice -> {
4141
CommonStrings.common_unable_to_decrypt_insecure_device to CompoundDrawables.ic_compound_block
4242
}
43-
UtdCause.HistoricalMessage -> {
43+
UtdCause.HistoricalMessageAndBackupIsDisabled -> {
4444
CommonStrings.timeline_decryption_failure_historical_event_no_key_backup to CompoundDrawables.ic_compound_block
4545
}
46+
UtdCause.HistoricalMessageAndDeviceIsUnverified -> {
47+
CommonStrings.timeline_decryption_failure_historical_event_unverified_device to CompoundDrawables.ic_compound_block
48+
}
4649
UtdCause.WithheldUnverifiedOrInsecureDevice -> {
4750
CommonStrings.timeline_decryption_failure_withheld_unverified to CompoundDrawables.ic_compound_block
4851
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemEncryptedContentProvider.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ open class TimelineItemEncryptedContentProvider : PreviewParameterProvider<Timel
3636
aTimelineItemEncryptedContent(
3737
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
3838
sessionId = "sessionId",
39-
utdCause = UtdCause.HistoricalMessage,
39+
utdCause = UtdCause.HistoricalMessageAndBackupIsDisabled,
40+
)
41+
),
42+
aTimelineItemEncryptedContent(
43+
data = UnableToDecryptContent.Data.MegolmV1AesSha2(
44+
sessionId = "sessionId",
45+
utdCause = UtdCause.HistoricalMessageAndDeviceIsUnverified,
4046
)
4147
),
4248
aTimelineItemEncryptedContent(

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ jsoup = "org.jsoup:jsoup:1.18.3"
173173
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
174174
molecule-runtime = "app.cash.molecule:molecule-runtime:2.0.0"
175175
timber = "com.jakewharton.timber:timber:5.0.1"
176-
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.71"
176+
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.2.72"
177177
matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
178178
matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" }
179179
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" }

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/room/CurrentUserMembership.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ enum class CurrentUserMembership {
1212
JOINED,
1313
LEFT,
1414
KNOCKED,
15+
BANNED,
1516
}

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/timeline/item/event/UtdCause.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@ enum class UtdCause {
1515
UnknownDevice,
1616

1717
/**
18-
* Expected utd because this is a device-historical message and
19-
* key storage is not setup or not configured correctly.
18+
* We are missing the keys for this event, but it is a "device-historical" message and
19+
* there is no key storage backup on the server, presumably because the user has turned it off.
2020
*/
21-
HistoricalMessage,
21+
HistoricalMessageAndBackupIsDisabled,
22+
23+
/**
24+
* We are missing the keys for this event, but it is a "device-historical"
25+
* message, and even though a key storage backup does exist, we can't use
26+
* it because our device is unverified.
27+
*/
28+
HistoricalMessageAndDeviceIsUnverified,
2229

2330
/**
2431
* The key was withheld on purpose because your device is insecure and/or the

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/analytics/UtdTracker.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class UtdTracker(
2727
UtdCause.UNKNOWN_DEVICE -> {
2828
Error.Name.ExpectedSentByInsecureDevice
2929
}
30-
UtdCause.HISTORICAL_MESSAGE -> Error.Name.HistoricalMessage
30+
UtdCause.HISTORICAL_MESSAGE_AND_BACKUP_IS_DISABLED,
31+
UtdCause.HISTORICAL_MESSAGE_AND_DEVICE_IS_UNVERIFIED,
32+
-> Error.Name.HistoricalMessage
3133
UtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> Error.Name.RoomKeysWithheldForUnverifiedDevice
3234
UtdCause.WITHHELD_BY_SENDER -> Error.Name.OlmKeysNotSentError
3335
}

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/MatrixRoomInfoMapper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ fun RustMembership.map(): CurrentUserMembership = when (this) {
6767
RustMembership.JOINED -> CurrentUserMembership.JOINED
6868
RustMembership.LEFT -> CurrentUserMembership.LEFT
6969
Membership.KNOCKED -> CurrentUserMembership.KNOCKED
70+
RustMembership.BANNED -> CurrentUserMembership.BANNED
7071
}
7172

7273
fun RustRoomNotificationMode.map(): RoomNotificationMode = when (this) {

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ private fun RustUtdCause.map(): UtdCause {
145145
RustUtdCause.VERIFICATION_VIOLATION -> UtdCause.VerificationViolation
146146
RustUtdCause.UNSIGNED_DEVICE -> UtdCause.UnsignedDevice
147147
RustUtdCause.UNKNOWN_DEVICE -> UtdCause.UnknownDevice
148-
RustUtdCause.HISTORICAL_MESSAGE -> UtdCause.HistoricalMessage
148+
RustUtdCause.HISTORICAL_MESSAGE_AND_BACKUP_IS_DISABLED -> UtdCause.HistoricalMessageAndBackupIsDisabled
149+
RustUtdCause.HISTORICAL_MESSAGE_AND_DEVICE_IS_UNVERIFIED -> UtdCause.HistoricalMessageAndDeviceIsUnverified
149150
RustUtdCause.WITHHELD_FOR_UNVERIFIED_OR_INSECURE_DEVICE -> UtdCause.WithheldUnverifiedOrInsecureDevice
150151
RustUtdCause.WITHHELD_BY_SENDER -> UtdCause.WithheldBySender
151152
}

libraries/ui-strings/src/main/res/values/localazy.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ We do not recommend enabling encryption for rooms that anyone can find and join.
360360
<string name="test_language_identifier">"en"</string>
361361
<string name="test_untranslated_default_language_identifier">"en"</string>
362362
<string name="timeline_decryption_failure_historical_event_no_key_backup">"Historical messages are not available on this device"</string>
363+
<string name="timeline_decryption_failure_historical_event_unverified_device">"You need to verify this device for access to historical messages"</string>
363364
<string name="timeline_decryption_failure_historical_event_user_not_joined">"You don\'t have access to this message"</string>
364365
<string name="timeline_decryption_failure_unable_to_decrypt">"Unable to decrypt message"</string>
365366
<string name="timeline_decryption_failure_withheld_unverified">"This message was blocked either because you did not verify your device or because the sender needs to verify your identity."</string>

0 commit comments

Comments
 (0)