Skip to content

Commit

Permalink
Merge branch 'release/cycle-4.6' into fix/reappearing-keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
saleniuk authored Jan 10, 2025
2 parents be4a31e + bef00f6 commit 5ae039a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,10 @@ fun GroupConversationSettings(
onCheckedChange = onReadReceiptSwitchClicked
)
}
if (state.mlsEnabled) {
item {
ConversationProtocolDetails(
protocolInfo = state.protocolInfo
)
}
item {
ConversationProtocolDetails(
protocolInfo = state.protocolInfo
)
}
}
}
Expand All @@ -171,29 +169,27 @@ fun ConversationProtocolDetails(
) {
Column {
FolderHeader(name = stringResource(R.string.folder_label_protocol_details))
if (protocolInfo is Conversation.ProtocolInfo.MLS || BuildConfig.MLS_SUPPORT_ENABLED) {
ProtocolDetails(
label = UIText.StringResource(R.string.protocol),
text = UIText.DynamicString(protocolInfo.name())
)

if (protocolInfo is Conversation.ProtocolInfo.MLS) {
ProtocolDetails(
label = UIText.StringResource(R.string.protocol),
text = UIText.DynamicString(protocolInfo.name())
label = UIText.StringResource(R.string.cipher_suite),
text = UIText.DynamicString(protocolInfo.cipherSuite.toString())
)

if (protocolInfo is Conversation.ProtocolInfo.MLS) {
if (BuildConfig.PRIVATE_BUILD) {
ProtocolDetails(
label = UIText.StringResource(R.string.cipher_suite),
text = UIText.DynamicString(protocolInfo.cipherSuite.toString())
label = UIText.StringResource(R.string.last_key_material_update_label),
text = UIText.DynamicString(protocolInfo.keyingMaterialLastUpdate.toString())
)

if (BuildConfig.PRIVATE_BUILD) {
ProtocolDetails(
label = UIText.StringResource(R.string.last_key_material_update_label),
text = UIText.DynamicString(protocolInfo.keyingMaterialLastUpdate.toString())
)

ProtocolDetails(
label = UIText.StringResource(R.string.group_state_label),
text = UIText.DynamicString(protocolInfo.groupState.name)
)
}
ProtocolDetails(
label = UIText.StringResource(R.string.group_state_label),
text = UIText.DynamicString(protocolInfo.groupState.name)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ fun DeviceDetailsContent(
) {
state.device.mlsClientIdentity?.let { identity ->
item {
FolderHeader(
name = stringResource(id = R.string.label_mls_signature, state.mlsCipherSuiteSignature.orEmpty()).uppercase(),
modifier = Modifier
.background(MaterialTheme.wireColorScheme.background)
.fillMaxWidth()
)
DeviceMLSSignatureItem(identity.thumbprint, screenState::copyMessage)
Divider(color = MaterialTheme.wireColorScheme.background)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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
Expand Down Expand Up @@ -174,13 +175,27 @@ class DeviceDetailsViewModel @Inject constructor(
isCurrentDevice = result.isCurrentClient,
removeDeviceDialogState = RemoveDeviceDialogState.Hidden,
canBeRemoved = !result.isCurrentClient && isSelfClient && result.client.type == ClientType.Permanent,
mlsCipherSuiteSignature = MLSPublicKeyType.from(
result.client.mlsPublicKeys?.keys?.firstOrNull().orEmpty()
).let { mapCipherSuiteSignatureToShortName(it) }
)
}
}
}
}
}

private fun mapCipherSuiteSignatureToShortName(signature: MLSPublicKeyType): String {
return when (signature) {
MLSPublicKeyType.ECDSA_SECP256R1_SHA256 -> "P256"
MLSPublicKeyType.ECDSA_SECP384R1_SHA384 -> "P384"
MLSPublicKeyType.ECDSA_SECP521R1_SHA512 -> "P521"
MLSPublicKeyType.ED25519 -> "ED25519"
MLSPublicKeyType.ED448 -> "ED448"
is MLSPublicKeyType.Unknown -> "Unknown"
}
}

fun removeDevice(onSuccess: () -> Unit) {
viewModelScope.launch {
val isPasswordRequired: Boolean = when (val passwordRequiredResult = isPasswordRequired()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 mlsCipherSuiteSignature: String? = null,
)
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 20 files
+5 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/server/CustomServerConfigRepository.kt
+18 βˆ’6 logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/server/ServerConfigRepository.kt
+2 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+20 βˆ’4 .../src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetOrCreateOneToOneConversationUseCase.kt
+49 βˆ’13 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigrator.kt
+11 βˆ’2 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolver.kt
+15 βˆ’6 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/protocol/OneOnOneProtocolSelector.kt
+1 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/server/UpdateApiVersionsUseCase.kt
+13 βˆ’12 logic/src/commonTest/kotlin/com/wire/kalium/logic/configuration/CustomServerConfigRepositoryTest.kt
+4 βˆ’4 logic/src/commonTest/kotlin/com/wire/kalium/logic/configuration/ServerConfigRepositoryTest.kt
+52 βˆ’7 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneMigratorTest.kt
+20 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/mls/OneOnOneResolverTest.kt
+0 βˆ’42 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/protocol/OneOnOneProtocolSelectorTest.kt
+13 βˆ’13 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/server/UpdateApiVersionUseCaseTest.kt
+9 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/mls/OneOnOneMigratorArrangement.kt
+6 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/repository/MessageRepositoryArrangement.kt
+2 βˆ’2 persistence/src/commonMain/db_global/com/wire/kalium/persistence/ServerConfiguration.sq
+5 βˆ’3 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/daokaliumdb/ServerConfigurationDAO.kt
+34 βˆ’7 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/daokaliumdb/ServerConfigurationDAOTest.kt
+7 βˆ’0 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/globalDB/AccountsDAOTest.kt

0 comments on commit 5ae039a

Please sign in to comment.