Fix unverified session detection logic.
This commit is contained in:
parent
7db222af0c
commit
ec9843fb53
@ -71,7 +71,7 @@ class DevicesViewModel @AssistedInject constructor(
|
|||||||
.execute { async ->
|
.execute { async ->
|
||||||
if (async is Success) {
|
if (async is Success) {
|
||||||
val deviceFullInfoList = async.invoke()
|
val deviceFullInfoList = async.invoke()
|
||||||
val unverifiedSessionsCount = deviceFullInfoList.count { !it.cryptoDeviceInfo?.isVerified.orFalse() }
|
val unverifiedSessionsCount = deviceFullInfoList.count { !it.cryptoDeviceInfo?.trustLevel?.isCrossSigningVerified().orFalse() }
|
||||||
val inactiveSessionsCount = deviceFullInfoList.count { it.isInactive }
|
val inactiveSessionsCount = deviceFullInfoList.count { it.isInactive }
|
||||||
copy(
|
copy(
|
||||||
devices = async,
|
devices = async,
|
||||||
|
@ -68,7 +68,8 @@ class GetDeviceFullInfoListUseCase @Inject constructor(
|
|||||||
val cryptoDeviceInfo = cryptoList.firstOrNull { it.deviceId == deviceInfo.deviceId }
|
val cryptoDeviceInfo = cryptoList.firstOrNull { it.deviceId == deviceInfo.deviceId }
|
||||||
val roomEncryptionTrustLevel = getEncryptionTrustLevelForDeviceUseCase.execute(currentSessionCrossSigningInfo, cryptoDeviceInfo)
|
val roomEncryptionTrustLevel = getEncryptionTrustLevelForDeviceUseCase.execute(currentSessionCrossSigningInfo, cryptoDeviceInfo)
|
||||||
val isInactive = checkIfSessionIsInactiveUseCase.execute(deviceInfo.lastSeenTs ?: 0)
|
val isInactive = checkIfSessionIsInactiveUseCase.execute(deviceInfo.lastSeenTs ?: 0)
|
||||||
DeviceFullInfo(deviceInfo, cryptoDeviceInfo, roomEncryptionTrustLevel, isInactive)
|
val isCurrentDevice = currentSessionCrossSigningInfo.deviceId == cryptoDeviceInfo?.deviceId
|
||||||
|
DeviceFullInfo(deviceInfo, cryptoDeviceInfo, roomEncryptionTrustLevel, isInactive, isCurrentDevice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ class FilterDevicesUseCase @Inject constructor() {
|
|||||||
.filter {
|
.filter {
|
||||||
when (filterType) {
|
when (filterType) {
|
||||||
DeviceManagerFilterType.ALL_SESSIONS -> true
|
DeviceManagerFilterType.ALL_SESSIONS -> true
|
||||||
DeviceManagerFilterType.VERIFIED -> it.cryptoDeviceInfo?.isVerified.orFalse()
|
DeviceManagerFilterType.VERIFIED -> it.cryptoDeviceInfo?.trustLevel?.isCrossSigningVerified().orFalse()
|
||||||
DeviceManagerFilterType.UNVERIFIED -> !it.cryptoDeviceInfo?.isVerified.orFalse()
|
DeviceManagerFilterType.UNVERIFIED -> !it.cryptoDeviceInfo?.trustLevel?.isCrossSigningVerified().orFalse()
|
||||||
DeviceManagerFilterType.INACTIVE -> it.isInactive
|
DeviceManagerFilterType.INACTIVE -> it.isInactive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user