Skip to content

Commit a443e72

Browse files
authored
feat: Add sliding sync timeline events and extensions (#1054)
Add general extension framework for sliding sync, implementing the e2ee, to-device and account-data extensions as per existing proxy implementation. Add a new (ffi exposed) function to use activate the extensions. Also extends jack-in to have permanent login and storage support now, rather than posting an access token and expose messages inside the sliding-sync layer to actually use the decrypted messages if given. Contains a lot of fixes around these aspects, too, like uploading any remaining messages from the olm-machine on every sliding-sync-request or processing even if no room data is present (which can happen now as processing only extensions might takes place).
1 parent 2232092 commit a443e72

File tree

24 files changed

+669
-350
lines changed

24 files changed

+669
-350
lines changed

Cargo.lock

+109
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/matrix-sdk-crypto-ffi/src/machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl OlmMachine {
419419
key_counts: HashMap<String, i32>,
420420
unused_fallback_keys: Option<Vec<String>>,
421421
) -> Result<String, CryptoStoreError> {
422-
let events: ToDevice = serde_json::from_str(events)?;
422+
let to_device: ToDevice = serde_json::from_str(events)?;
423423
let device_changes: RumaDeviceLists = device_changes.into();
424424
let key_counts: BTreeMap<DeviceKeyAlgorithm, UInt> = key_counts
425425
.into_iter()
@@ -437,7 +437,7 @@ impl OlmMachine {
437437
unused_fallback_keys.map(|u| u.into_iter().map(DeviceKeyAlgorithm::from).collect());
438438

439439
let events = self.runtime.block_on(self.inner.receive_sync_changes(
440-
events,
440+
to_device.events,
441441
&device_changes,
442442
&key_counts,
443443
unused_fallback_keys.as_deref(),

bindings/matrix-sdk-crypto-ffi/src/responses.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use ruma::{
1919
},
2020
},
2121
message::send_message_event::v3::Response as RoomMessageResponse,
22-
sync::sync_events::v3::DeviceLists as RumaDeviceLists,
22+
sync::sync_events::DeviceLists as RumaDeviceLists,
2323
to_device::send_event_to_device::v3::Response as ToDeviceResponse,
2424
},
2525
assign,

bindings/matrix-sdk-crypto-js/src/sync_events.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{identifiers, js::downcast};
99
#[wasm_bindgen]
1010
#[derive(Debug)]
1111
pub struct DeviceLists {
12-
pub(crate) inner: ruma::api::client::sync::sync_events::v3::DeviceLists,
12+
pub(crate) inner: ruma::api::client::sync::sync_events::DeviceLists,
1313
}
1414

1515
#[wasm_bindgen]
@@ -19,7 +19,7 @@ impl DeviceLists {
1919
/// `changed` and `left` must be an array of `UserId`.
2020
#[wasm_bindgen(constructor)]
2121
pub fn new(changed: Option<Array>, left: Option<Array>) -> Result<DeviceLists, JsError> {
22-
let mut inner = ruma::api::client::sync::sync_events::v3::DeviceLists::default();
22+
let mut inner = ruma::api::client::sync::sync_events::DeviceLists::default();
2323

2424
inner.changed = changed
2525
.unwrap_or_default()

0 commit comments

Comments
 (0)