Skip to content

Commit c740781

Browse files
committed
Update matrix-rust-sdk to 183116a4b1
and adapt encrypt_room_event to preserve its interface despite the change introduced in matrix-org/matrix-rust-sdk#5936 .
1 parent ee8637a commit c740781

3 files changed

Lines changed: 31 additions & 33 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ futures-util = "0.3.27"
6464
getrandom = { version = "0.3.0", features = ["wasm_js"] }
6565
http = "1.1.0"
6666
js-sys = "0.3.49"
67-
matrix-sdk-common = { features = ["js", "experimental-encrypted-state-events"], version="0.16.0" }
68-
matrix-sdk-indexeddb = { default-features = false, features = ["e2e-encryption"], version="0.16.0" }
69-
matrix-sdk-qrcode = { optional = true, version="0.16.0" }
67+
matrix-sdk-common = { features = ["js", "experimental-encrypted-state-events"], git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "183116a4b1888039ad4d1714ac0d97f1375cc45a" }
68+
matrix-sdk-indexeddb = { default-features = false, features = ["e2e-encryption"], git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "183116a4b1888039ad4d1714ac0d97f1375cc45a" }
69+
matrix-sdk-qrcode = { optional = true, git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "183116a4b1888039ad4d1714ac0d97f1375cc45a" }
7070
serde = "1.0.91"
7171
serde_json = "1.0.91"
7272
serde-wasm-bindgen = "0.6.5"
@@ -85,7 +85,8 @@ vergen-gitcl = { version = "1.0.0", features = ["build"] }
8585
[dependencies.matrix-sdk-crypto]
8686
default-features = false
8787
features = ["js", "automatic-room-key-forwarding", "experimental-encrypted-state-events"]
88-
version = "0.16.0"
88+
git = "https://github.com/matrix-org/matrix-rust-sdk"
89+
rev = "183116a4b1888039ad4d1714ac0d97f1375cc45a"
8990

9091
[lints.rust]
9192
# Workaround for https://github.com/rustwasm/wasm-bindgen/issues/4283, while we work up the courage to upgrade

src/machine.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,19 @@ impl OlmMachine {
521521
let me = self.inner.clone();
522522

523523
Ok(future_to_promise(async move {
524-
Ok(serde_json::to_string(
525-
&me.encrypt_room_event_raw(&room_id, event_type.as_ref(), &content).await?,
526-
)?)
524+
let encryption_result =
525+
me.encrypt_room_event_raw(&room_id, event_type.as_ref(), &content).await?;
526+
527+
// Note: encryption_result contains EncryptionInfo that we discard here, but
528+
// might conceivably be of interest to our callers in future.
529+
//
530+
// See https://github.com/matrix-org/matrix-rust-sdk/pull/5936 for the change that
531+
// added this info.
532+
//
533+
// For now, we just return the event content, which preserves the same interface
534+
// we had before.
535+
536+
Ok(serde_json::to_string(&encryption_result.content)?)
527537
}))
528538
}
529539

0 commit comments

Comments
 (0)