diff --git a/rust-sdk/Cargo.toml b/rust-sdk/Cargo.toml index 9ee7b4bbf7..3d256ec661 100644 --- a/rust-sdk/Cargo.toml +++ b/rust-sdk/Cargo.toml @@ -29,11 +29,11 @@ features = ["lax_deserialize"] [dependencies.matrix-sdk-common] git = "https://github.com/matrix-org/matrix-rust-sdk/" -rev = "fc74526699b82ba5be3349e810ded51138dae7fc" +rev = "7b6132b71e499224ed25bdc571b2a54d076551d6" [dependencies.matrix-sdk-crypto] git = "https://github.com/matrix-org/matrix-rust-sdk/" -rev = "fc74526699b82ba5be3349e810ded51138dae7fc" +rev = "7b6132b71e499224ed25bdc571b2a54d076551d6" features = ["sled_cryptostore", "qrcode", "backups_v1"] [dependencies.tokio] diff --git a/rust-sdk/src/machine.rs b/rust-sdk/src/machine.rs index c7fa9741ab..1ffc30c764 100644 --- a/rust-sdk/src/machine.rs +++ b/rust-sdk/src/machine.rs @@ -628,8 +628,20 @@ impl OlmMachine { .block_on(self.inner.import_keys(keys, from_backup, listener))?; Ok(KeysImportResult { - total: result.total_count as i64, imported: result.imported_count as i64, + total: result.total_count as i64, + keys: result + .keys + .into_iter() + .map(|(r, m)| { + ( + r.to_string(), + m.into_iter() + .map(|(s, k)| (s, k.into_iter().collect())) + .collect(), + ) + }) + .collect(), }) } diff --git a/rust-sdk/src/olm.udl b/rust-sdk/src/olm.udl index 894d9afe3c..675dc466e6 100644 --- a/rust-sdk/src/olm.udl +++ b/rust-sdk/src/olm.udl @@ -59,8 +59,9 @@ dictionary DeviceLists { }; dictionary KeysImportResult { - i64 total; i64 imported; + i64 total; + record>> keys; }; dictionary DecryptedEvent { diff --git a/rust-sdk/src/responses.rs b/rust-sdk/src/responses.rs index a7e9308d32..23ea870ec7 100644 --- a/rust-sdk/src/responses.rs +++ b/rust-sdk/src/responses.rs @@ -295,8 +295,15 @@ impl From for RumaDeviceLists { } pub struct KeysImportResult { - pub total: i64, + /// The number of room keys that were imported. pub imported: i64, + /// The total number of room keys that were found in the export. + pub total: i64, + /// The map of keys that were imported. + /// + /// It's a map from room id to a map of the sender key to a list of session + /// ids. + pub keys: HashMap>>, } pub(crate) enum OwnedResponse {