diff --git a/changelog.d/945.improvements b/changelog.d/945.improvements new file mode 100644 index 0000000000..ca2de53974 --- /dev/null +++ b/changelog.d/945.improvements @@ -0,0 +1 @@ +Supprimer le blocage d'envoi de messages chiffrés aux appareils non vérifiés (945) \ No newline at end of file diff --git a/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt b/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt index e3595f6618..d5ffd0d3d6 100644 --- a/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt +++ b/matrix-sdk-android/src/kotlinCrypto/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt @@ -1158,7 +1158,9 @@ internal class RealmCryptoStore @Inject constructor( } ) return Transformations.map(liveData) { - it.firstOrNull() ?: false + // Tchap : force to false to avoid "Never send messages to non verified devices" + // it.firstOrNull() ?: false + false } } diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/store/RustCryptoStore.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/store/RustCryptoStore.kt index b242a3ed34..a565773bf1 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/store/RustCryptoStore.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/store/RustCryptoStore.kt @@ -372,7 +372,9 @@ internal class RustCryptoStore @Inject constructor( } ) return Transformations.map(liveData) { - it.firstOrNull() ?: false + // Tchap : force to false to avoid "Never send messages to non verified devices" + // it.firstOrNull() ?: false + false } } diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt index 36c9f81886..19933158e3 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileController.kt @@ -205,30 +205,32 @@ class RoomProfileController @Inject constructor( host.callback?.openGlobalBlockSettings() } } - } else { - // per room setting is available - val shouldBlockUnverified = data.encryptToVerifiedDeviceOnly.invoke() - formSwitchItem { - id("send_to_unverified") - enabled(shouldBlockUnverified != null) - title(host.stringProvider.getString(R.string.encryption_never_send_to_unverified_devices_in_room)) - - switchChecked(shouldBlockUnverified ?: false) - - apply { - if (shouldBlockUnverified == true && data.unverifiedDevicesInTheRoom.invoke() == true) { - summary( - host.stringProvider.getString(R.string.some_devices_will_not_be_able_to_decrypt) - ) - } else { - summary(null) - } - } - listener { value -> - host.callback?.setEncryptedToVerifiedDevicesOnly(value) - } - } } + // Tchap : don't display option "Never send messages to unverified devices in room" +// else { +// // per room setting is available +// val shouldBlockUnverified = data.encryptToVerifiedDeviceOnly.invoke() +// formSwitchItem { +// id("send_to_unverified") +// enabled(shouldBlockUnverified != null) +// title(host.stringProvider.getString(R.string.encryption_never_send_to_unverified_devices_in_room)) +// +// switchChecked(shouldBlockUnverified ?: false) +// +// apply { +// if (shouldBlockUnverified == true && data.unverifiedDevicesInTheRoom.invoke() == true) { +// summary( +// host.stringProvider.getString(R.string.some_devices_will_not_be_able_to_decrypt) +// ) +// } else { +// summary(null) +// } +// } +// listener { value -> +// host.callback?.setEncryptedToVerifiedDevicesOnly(value) +// } +// } +// } } } // More diff --git a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt index 2f1b521d53..4ce1b260c4 100644 --- a/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt @@ -292,7 +292,7 @@ class RoomProfileViewModel @AssistedInject constructor( private fun setEncryptToVerifiedDeviceOnly(enabled: Boolean) { session.coroutineScope.launch { - session.cryptoService().setRoomBlockUnverifiedDevices(room.roomId, enabled) + session.cryptoService().setRoomBlockUnverifiedDevices(room.roomId, enabled and false) // Tchap : force to false to deactivate "Never send messages to unverified devices in room" } }