crypto: Update for the new room key import result

This commit is contained in:
Damir Jelić 2021-11-12 11:57:52 +01:00
parent 7cb143e970
commit e5af7e6109
4 changed files with 9 additions and 8 deletions

View File

@ -500,7 +500,8 @@ internal class OlmMachine(
val result = inner.importKeys(decodedKeys, passphrase, rustListener) val result = inner.importKeys(decodedKeys, passphrase, rustListener)
ImportRoomKeysResult(result.total, result.imported) // TODO do we want to remove the cast here?
ImportRoomKeysResult(result.total.toInt(), result.imported.toInt())
} }
@Throws(CryptoStoreException::class) @Throws(CryptoStoreException::class)
@ -516,7 +517,7 @@ internal class OlmMachine(
val result = inner.importDecryptedKeys(encodedKeys, rustListener) val result = inner.importDecryptedKeys(encodedKeys, rustListener)
ImportRoomKeysResult(result.total, result.imported) ImportRoomKeysResult(result.total.toInt(), result.imported.toInt())
} }
@Throws(CryptoStoreException::class) @Throws(CryptoStoreException::class)

View File

@ -618,8 +618,8 @@ impl OlmMachine {
.block_on(self.inner.import_keys(keys, listener))?; .block_on(self.inner.import_keys(keys, listener))?;
Ok(KeysImportResult { Ok(KeysImportResult {
total: result.1 as i32, total: result.total_count as i64,
imported: result.0 as i32, imported: result.imported_count as i64,
}) })
} }

View File

@ -58,8 +58,8 @@ dictionary DeviceLists {
}; };
dictionary KeysImportResult { dictionary KeysImportResult {
i32 total; i64 total;
i32 imported; i64 imported;
}; };
dictionary DecryptedEvent { dictionary DecryptedEvent {

View File

@ -295,8 +295,8 @@ impl From<DeviceLists> for RumaDeviceLists {
} }
pub struct KeysImportResult { pub struct KeysImportResult {
pub total: i32, pub total: i64,
pub imported: i32, pub imported: i64,
} }
pub(crate) enum OwnedResponse { pub(crate) enum OwnedResponse {