mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-29 15:40:55 +08:00
fix rust device to CryptoDeviceInfo mapping
This commit is contained in:
parent
def2a8a833
commit
3fa3eb1129
@ -172,8 +172,6 @@ internal class Device @AssistedInject constructor(
|
|||||||
* This will not fetch out fresh data from the Rust side.
|
* This will not fetch out fresh data from the Rust side.
|
||||||
**/
|
**/
|
||||||
internal fun toCryptoDeviceInfo(): CryptoDeviceInfo {
|
internal fun toCryptoDeviceInfo(): CryptoDeviceInfo {
|
||||||
// val keys = innerDevice.keys.map { (keyId, key) -> keyId to key }.toMap()
|
|
||||||
|
|
||||||
return CryptoDeviceInfo(
|
return CryptoDeviceInfo(
|
||||||
deviceId = innerDevice.deviceId,
|
deviceId = innerDevice.deviceId,
|
||||||
userId = innerDevice.userId,
|
userId = innerDevice.userId,
|
||||||
|
@ -189,18 +189,21 @@ internal class OlmMachine @Inject constructor(
|
|||||||
is OwnUserIdentity -> ownIdentity.trustsOurOwnDevice()
|
is OwnUserIdentity -> ownIdentity.trustsOurOwnDevice()
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
val ownDevice = inner.getDevice(userId(), deviceId, 0u)!!
|
||||||
|
val creationTime = ownDevice.firstTimeSeenTs.toLong()
|
||||||
|
|
||||||
return CryptoDeviceInfo(
|
return CryptoDeviceInfo(
|
||||||
deviceId(),
|
deviceId(),
|
||||||
userId(),
|
userId(),
|
||||||
// TODO pass the algorithms here.
|
ownDevice.algorithms,
|
||||||
listOf(),
|
|
||||||
keys,
|
keys,
|
||||||
mapOf(),
|
mapOf(),
|
||||||
UnsignedDeviceInfo(),
|
UnsignedDeviceInfo(
|
||||||
|
deviceDisplayName = ownDevice.displayName
|
||||||
|
),
|
||||||
DeviceTrustLevel(crossSigningVerified, locallyVerified = true),
|
DeviceTrustLevel(crossSigningVerified, locallyVerified = true),
|
||||||
false,
|
false,
|
||||||
null
|
creationTime
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,7 +294,7 @@ internal class OlmMachine @Inject constructor(
|
|||||||
// checking the returned to devices to check for room keys.
|
// checking the returned to devices to check for room keys.
|
||||||
// XXX Anyhow there is now proper signaling we should soon stop parsing them manually
|
// XXX Anyhow there is now proper signaling we should soon stop parsing them manually
|
||||||
receiveSyncChanges.toDeviceEvents.map {
|
receiveSyncChanges.toDeviceEvents.map {
|
||||||
outAdapter.fromJson(it) ?: Event()
|
outAdapter.fromJson(it) ?: Event()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -882,6 +885,7 @@ internal class OlmMachine @Inject constructor(
|
|||||||
inner.queryMissingSecretsFromOtherSessions()
|
inner.queryMissingSecretsFromOtherSessions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Throws(CryptoStoreException::class)
|
@Throws(CryptoStoreException::class)
|
||||||
suspend fun enableBackupV1(key: String, version: String) {
|
suspend fun enableBackupV1(key: String, version: String) {
|
||||||
return withContext(coroutineDispatchers.computation) {
|
return withContext(coroutineDispatchers.computation) {
|
||||||
|
Loading…
Reference in New Issue
Block a user