rust: Bump the sdk version

This updates the rust-sdk to support fallback keys, note that fallback
keys are not yet uploaded, they just can be used when downloaded and
info about the fallback keys coming from a sync can be passed to the
rust side.
This commit is contained in:
Damir Jelić 2021-12-09 13:15:54 +01:00
parent 5109f10833
commit ee017b7302
4 changed files with 13 additions and 5 deletions

View file

@ -309,7 +309,9 @@ internal class OlmMachine(
MoshiProvider.providesMoshi().adapter(ToDeviceSyncResponse::class.java)
val events = adapter.toJson(toDevice ?: ToDeviceSyncResponse())!!
adapter.fromJson(inner.receiveSyncChanges(events, devices, counts)) ?: ToDeviceSyncResponse()
// TODO once our sync response type parses the unused fallback key
// field pass in the list of unused fallback keys here
adapter.fromJson(inner.receiveSyncChanges(events, devices, counts, unusedFallbackKeys = null)) ?: ToDeviceSyncResponse()
}
// We may get cross signing keys over a to-device event, update our listeners.

View file

@ -29,11 +29,11 @@ features = ["lax_deserialize"]
[dependencies.matrix-sdk-common]
git = "https://github.com/matrix-org/matrix-rust-sdk/"
rev = "8494f105837af824f4637c05e9e01b0854d7109b"
rev = "009ead2eeaf365e1fb0f790557f20d4eaf6874ae"
[dependencies.matrix-sdk-crypto]
git = "https://github.com/matrix-org/matrix-rust-sdk/"
rev = "8494f105837af824f4637c05e9e01b0854d7109b"
rev = "009ead2eeaf365e1fb0f790557f20d4eaf6874ae"
features = ["sled_cryptostore", "qrcode", "backups_v1"]
[dependencies.tokio]
@ -43,7 +43,7 @@ features = ["rt-multi-thread"]
[dependencies.ruma]
git = "https://github.com/ruma/ruma"
rev = "6c4892664"
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"
features = ["client-api-c"]
[build-dependencies]

View file

@ -344,6 +344,7 @@ impl OlmMachine {
events: &str,
device_changes: DeviceLists,
key_counts: HashMap<String, i32>,
unused_fallback_keys: Option<Vec<String>>,
) -> Result<String, CryptoStoreError> {
let events: ToDevice = serde_json::from_str(events)?;
let device_changes: RumaDeviceLists = device_changes.into();
@ -359,10 +360,14 @@ impl OlmMachine {
})
.collect();
let unused_fallback_keys: Option<Vec<DeviceKeyAlgorithm>> =
unused_fallback_keys.map(|u| u.into_iter().map(DeviceKeyAlgorithm::from).collect());
let events = self.runtime.block_on(self.inner.receive_sync_changes(
events,
&device_changes,
&key_counts,
unused_fallback_keys.as_deref(),
))?;
Ok(serde_json::to_string(&events)?)

View file

@ -244,7 +244,8 @@ interface OlmMachine {
[Throws=CryptoStoreError]
string receive_sync_changes([ByRef] string events,
DeviceLists device_changes,
record<DOMString, i32> key_counts);
record<DOMString, i32> key_counts,
sequence<string>? unused_fallback_keys);
[Throws=CryptoStoreError]
sequence<Request> outgoing_requests();
[Throws=CryptoStoreError]