parent
76788892c0
commit
c9c787b11d
|
@ -70,7 +70,7 @@ class RxSession(private val session: Session) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun liveMyDeviceInfo(): Observable<List<DeviceInfo>> {
|
fun liveMyDevicesInfo(): Observable<List<DeviceInfo>> {
|
||||||
return session.cryptoService().getLiveMyDevicesInfo().asObservable()
|
return session.cryptoService().getLiveMyDevicesInfo().asObservable()
|
||||||
.startWithCallable {
|
.startWithCallable {
|
||||||
session.cryptoService().getMyDevicesInfo()
|
session.cryptoService().getMyDevicesInfo()
|
||||||
|
|
|
@ -100,7 +100,7 @@ class UnknownDeviceDetectorSharedViewModel @AssistedInject constructor(@Assisted
|
||||||
|
|
||||||
Observable.combineLatest<List<CryptoDeviceInfo>, List<DeviceInfo>, Optional<PrivateKeysInfo>, List<DeviceDetectionInfo>>(
|
Observable.combineLatest<List<CryptoDeviceInfo>, List<DeviceInfo>, Optional<PrivateKeysInfo>, List<DeviceDetectionInfo>>(
|
||||||
session.rx().liveUserCryptoDevices(session.myUserId),
|
session.rx().liveUserCryptoDevices(session.myUserId),
|
||||||
session.rx().liveMyDeviceInfo(),
|
session.rx().liveMyDevicesInfo(),
|
||||||
session.rx().liveCrossSigningPrivateKeys(),
|
session.rx().liveCrossSigningPrivateKeys(),
|
||||||
Function3 { cryptoList, infoList, pInfo ->
|
Function3 { cryptoList, infoList, pInfo ->
|
||||||
// Timber.v("## Detector trigger ${cryptoList.map { "${it.deviceId} ${it.trustLevel}" }}")
|
// Timber.v("## Detector trigger ${cryptoList.map { "${it.deviceId} ${it.trustLevel}" }}")
|
||||||
|
|
|
@ -37,10 +37,10 @@ class CrossSigningSettingsViewModel @AssistedInject constructor(@Assisted privat
|
||||||
|
|
||||||
init {
|
init {
|
||||||
Observable.combineLatest<List<DeviceInfo>, Optional<MXCrossSigningInfo>, Pair<List<DeviceInfo>, Optional<MXCrossSigningInfo>>>(
|
Observable.combineLatest<List<DeviceInfo>, Optional<MXCrossSigningInfo>, Pair<List<DeviceInfo>, Optional<MXCrossSigningInfo>>>(
|
||||||
session.rx().liveMyDeviceInfo(),
|
session.rx().liveMyDevicesInfo(),
|
||||||
session.rx().liveCrossSigningInfo(session.myUserId),
|
session.rx().liveCrossSigningInfo(session.myUserId),
|
||||||
BiFunction { myDeviceInfo, mxCrossSigningInfo ->
|
BiFunction { myDevicesInfo, mxCrossSigningInfo ->
|
||||||
(myDeviceInfo to mxCrossSigningInfo)
|
myDevicesInfo to mxCrossSigningInfo
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.execute { data ->
|
.execute { data ->
|
||||||
|
|
|
@ -81,7 +81,7 @@ class DeviceVerificationInfoBottomSheetViewModel @AssistedInject constructor(@As
|
||||||
copy(deviceInfo = Loading())
|
copy(deviceInfo = Loading())
|
||||||
}
|
}
|
||||||
|
|
||||||
session.rx().liveMyDeviceInfo()
|
session.rx().liveMyDevicesInfo()
|
||||||
.map { devices ->
|
.map { devices ->
|
||||||
devices.firstOrNull { it.deviceId == deviceId } ?: DeviceInfo(deviceId = deviceId)
|
devices.firstOrNull { it.deviceId == deviceId } ?: DeviceInfo(deviceId = deviceId)
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ class DevicesViewModel @AssistedInject constructor(
|
||||||
|
|
||||||
Observable.combineLatest<List<CryptoDeviceInfo>, List<DeviceInfo>, List<DeviceFullInfo>>(
|
Observable.combineLatest<List<CryptoDeviceInfo>, List<DeviceInfo>, List<DeviceFullInfo>>(
|
||||||
session.rx().liveUserCryptoDevices(session.myUserId),
|
session.rx().liveUserCryptoDevices(session.myUserId),
|
||||||
session.rx().liveMyDeviceInfo(),
|
session.rx().liveMyDevicesInfo(),
|
||||||
BiFunction { cryptoList, infoList ->
|
BiFunction { cryptoList, infoList ->
|
||||||
infoList
|
infoList
|
||||||
.sortedByDescending { it.lastSeenTs }
|
.sortedByDescending { it.lastSeenTs }
|
||||||
|
|
Loading…
Reference in New Issue