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 { views.ssssResetOtherDevices.debouncedClicks {
withState(sharedViewModel) { 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 @Parcelize
data class Args( data class Args(
val userId: String, val userId: String,
val allowDeviceAction: Boolean
) : Parcelable ) : Parcelable
companion object { companion object {
fun newInstance(userId: String, allowDeviceAction: Boolean = true): DeviceListBottomSheet { fun newInstance(userId: String): DeviceListBottomSheet {
return DeviceListBottomSheet().apply { 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 // TODO Replace usage by the use case GetEncryptionTrustLevelForDeviceUseCase
object TrustUtils { object TrustUtils {
// XXX why is this using the RoomEncryptionTrustLevel?
// should be using a new DeviceTrustShield enum
fun shieldForTrust( fun shieldForTrust(
currentDevice: Boolean, currentDevice: Boolean,
trustMSK: Boolean, trustMSK: Boolean,

View file

@ -25,6 +25,8 @@ class GetEncryptionTrustLevelForDeviceUseCase @Inject constructor(
private val getEncryptionTrustLevelForOtherDeviceUseCase: GetEncryptionTrustLevelForOtherDeviceUseCase, 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? { fun execute(currentSessionCrossSigningInfo: CurrentSessionCrossSigningInfo, cryptoDeviceInfo: CryptoDeviceInfo?): RoomEncryptionTrustLevel? {
if (cryptoDeviceInfo == null) { if (cryptoDeviceInfo == null) {
return null return null