Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supprimer le blocage d'envoi de messages chiffrés aux appareils non vérifiés #947

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/945.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Supprimer le blocage d'envoi de messages chiffrés aux appareils non vérifiés (945)
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
Loading