crypto: Get devices from the rust-sdk

This commit is contained in:
Damir Jelić 2021-03-30 13:47:15 +02:00
parent 5533c2acae
commit 9d5ef01ce0

View File

@ -395,7 +395,15 @@ internal class DefaultCryptoService @Inject constructor(
*/
override fun getDeviceInfo(userId: String, deviceId: String?): CryptoDeviceInfo? {
return if (userId.isNotEmpty() && !deviceId.isNullOrEmpty()) {
cryptoStore.getUserDevice(userId, deviceId)
val device = runBlocking {
olmMachine!!.getDevice(userId, deviceId)
}
if (device != null) {
device.toCryptoDeviceInfo()
} else {
null
}
} else {
null
}