code review

This commit is contained in:
valere 2023-05-23 16:38:53 +02:00
parent 94956a2ec6
commit bb59a758cf
4 changed files with 5 additions and 6 deletions

View file

@ -52,7 +52,7 @@ class SharedSecuredStorageResetAllFragment :
views.ssssResetOtherDevices.debouncedClicks {
withState(sharedViewModel) {
DeviceListBottomSheet.newInstance(it.userId, false).show(childFragmentManager, "DEV_LIST")
DeviceListBottomSheet.newInstance(it.userId).show(childFragmentManager, "DEV_LIST")
}
}

View file

@ -100,13 +100,12 @@ class DeviceListBottomSheet :
@Parcelize
data class Args(
val userId: String,
val allowDeviceAction: Boolean
) : Parcelable
companion object {
fun newInstance(userId: String, allowDeviceAction: Boolean = true): DeviceListBottomSheet {
fun newInstance(userId: String): DeviceListBottomSheet {
return DeviceListBottomSheet().apply {
setArguments(Args(userId, allowDeviceAction))
setArguments(Args(userId))
}
}
}

View file

@ -22,8 +22,6 @@ import org.matrix.android.sdk.api.session.crypto.model.RoomEncryptionTrustLevel
// TODO Replace usage by the use case GetEncryptionTrustLevelForDeviceUseCase
object TrustUtils {
// XXX why is this using the RoomEncryptionTrustLevel?
// should be using a new DeviceTrustShield enum
fun shieldForTrust(
currentDevice: Boolean,
trustMSK: Boolean,

View file

@ -25,6 +25,8 @@ class GetEncryptionTrustLevelForDeviceUseCase @Inject constructor(
private val getEncryptionTrustLevelForOtherDeviceUseCase: GetEncryptionTrustLevelForOtherDeviceUseCase,
) {
// XXX why is this using the RoomEncryptionTrustLevel?
// should be using a new DeviceTrustShield enum
fun execute(currentSessionCrossSigningInfo: CurrentSessionCrossSigningInfo, cryptoDeviceInfo: CryptoDeviceInfo?): RoomEncryptionTrustLevel? {
if (cryptoDeviceInfo == null) {
return null