From 2490ba16c8f36412ea5a200e5b6e17738466be41 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Fri, 13 Dec 2024 15:50:00 +0100 Subject: [PATCH] feat: add signature used for mls client device --- .../wire/android/ui/authentication/devices/model/Device.kt | 1 + .../wire/android/ui/settings/devices/DeviceDetailsScreen.kt | 6 ++++++ .../android/ui/settings/devices/DeviceDetailsViewModel.kt | 4 ++++ .../android/ui/settings/devices/model/DeviceDetailsState.kt | 3 ++- kalium | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/model/Device.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/model/Device.kt index 0f271364d51..6045d874618 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/model/Device.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/model/Device.kt @@ -26,6 +26,7 @@ import com.wire.android.R import com.wire.android.util.ui.UIText import com.wire.kalium.logic.data.client.Client import com.wire.kalium.logic.data.conversation.ClientId +import com.wire.kalium.logic.data.mls.MLSPublicKeys import com.wire.kalium.logic.feature.e2ei.MLSClientIdentity import com.wire.kalium.logic.util.inWholeWeeks import com.wire.kalium.util.DateTimeUtil.toIsoDateTimeString diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt index 422d9647472..4c0f89e10ff 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt @@ -204,6 +204,12 @@ fun DeviceDetailsContent( ) { state.device.mlsClientIdentity?.let { identity -> item { + FolderHeader( + name = stringResource(id = R.string.label_mls_signature, state.mlsCipherSuite.orEmpty()).uppercase(), + modifier = Modifier + .background(MaterialTheme.wireColorScheme.background) + .fillMaxWidth() + ) DeviceMLSSignatureItem(identity.thumbprint, screenState::copyMessage) HorizontalDivider(color = MaterialTheme.wireColorScheme.background) } diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt index f6d06b76b68..d4ee7445a68 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModel.kt @@ -37,6 +37,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.ClientType import com.wire.kalium.logic.data.client.DeleteClientParam import com.wire.kalium.logic.data.conversation.ClientId +import com.wire.kalium.logic.data.mlspublickeys.MLSPublicKeyType import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.client.ClientFingerprintUseCase import com.wire.kalium.logic.feature.client.DeleteClientResult @@ -198,6 +199,9 @@ class DeviceDetailsViewModel @Inject constructor( isCurrentDevice = result.isCurrentClient, removeDeviceDialogState = RemoveDeviceDialogState.Hidden, canBeRemoved = !result.isCurrentClient && isSelfClient && result.client.type != ClientType.LegalHold, + mlsCipherSuite = MLSPublicKeyType.from( + result.client.mlsPublicKeys?.keys?.firstOrNull().orEmpty() + ).value.toString() ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt index b68745619e9..c0151629c1a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/model/DeviceDetailsState.kt @@ -37,5 +37,6 @@ data class DeviceDetailsState( val isE2EICertificateEnrollSuccess: Boolean = false, val isE2EICertificateEnrollError: Boolean = false, val isE2EIEnabled: Boolean = false, - val startGettingE2EICertificate: Boolean = false + val startGettingE2EICertificate: Boolean = false, + val mlsCipherSuite: String? = null, ) diff --git a/kalium b/kalium index c9f091b3923..6518915d0ac 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit c9f091b392378afa02a1ca0df92d41052b0439a1 +Subproject commit 6518915d0ac5ab78f9e34d7ab676c686e0c14d2f