mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 12:00:03 +03:00
Fix unverified popup for own device
See issue on rust sdk for not having own device has locally trusted
This commit is contained in:
parent
4dee5d2366
commit
98f1c6d87f
1 changed files with 9 additions and 3 deletions
|
@ -102,12 +102,17 @@ class UnknownDeviceDetectorSharedViewModel @AssistedInject constructor(
|
|||
session.flow().liveMyDevicesInfo(),
|
||||
session.flow().liveCrossSigningPrivateKeys(),
|
||||
) { cryptoList, infoList, pInfo ->
|
||||
// Timber.v("## Detector trigger ${cryptoList.map { "${it.deviceId} ${it.trustLevel}" }}")
|
||||
// Timber.v("## Detector trigger canCrossSign ${pInfo.get().selfSigned != null}")
|
||||
Timber.v("## Detector trigger ${cryptoList.map { "${it.deviceId} ${it.trustLevel}" }}")
|
||||
Timber.v("## Detector trigger canCrossSign ${pInfo.get().selfSigned != null}")
|
||||
|
||||
deleteUnusedClientInformation(infoList)
|
||||
|
||||
infoList
|
||||
.asSequence()
|
||||
.filter {
|
||||
// filter out own device
|
||||
session.sessionParams.deviceId != it.deviceId
|
||||
}
|
||||
.filter { info ->
|
||||
// filter out verified sessions or those which do not support encryption (i.e. without crypto info)
|
||||
cryptoList.firstOrNull { info.deviceId == it.deviceId }?.isVerified?.not().orFalse()
|
||||
|
@ -125,10 +130,11 @@ class UnknownDeviceDetectorSharedViewModel @AssistedInject constructor(
|
|||
pInfo.getOrNull()?.selfSigned != null // adding this to pass distinct when cross sign change
|
||||
)
|
||||
}
|
||||
.toList()
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
.execute { async ->
|
||||
// Timber.v("## Detector trigger passed distinct")
|
||||
Timber.v("## Detector trigger passed distinct")
|
||||
copy(
|
||||
myMatrixItem = session.getUserOrDefault(session.myUserId).toMatrixItem(),
|
||||
unknownSessions = async
|
||||
|
|
Loading…
Add table
Reference in a new issue