From 94fadf74b99e4ffbaaad618dde1cbba7921b81fc Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Wed, 18 Jan 2023 13:31:26 +0100 Subject: [PATCH] feat(crypto-js): Rename `RoomMessageRequest.content` to `.body`. --- bindings/matrix-sdk-crypto-js/src/requests.rs | 4 ++-- bindings/matrix-sdk-crypto-js/tests/machine.test.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/matrix-sdk-crypto-js/src/requests.rs b/bindings/matrix-sdk-crypto-js/src/requests.rs index ce0904195..00b51731d 100644 --- a/bindings/matrix-sdk-crypto-js/src/requests.rs +++ b/bindings/matrix-sdk-crypto-js/src/requests.rs @@ -243,8 +243,8 @@ pub struct RoomMessageRequest { #[wasm_bindgen(readonly)] pub event_type: JsString, - /// A JSON-encoded string containing the message's content. - #[wasm_bindgen(readonly)] + /// A JSON-encoded string containing the message's body. + #[wasm_bindgen(readonly, js_name = "body")] pub content: JsString, } diff --git a/bindings/matrix-sdk-crypto-js/tests/machine.test.js b/bindings/matrix-sdk-crypto-js/tests/machine.test.js index a74135d0d..32e46086a 100644 --- a/bindings/matrix-sdk-crypto-js/tests/machine.test.js +++ b/bindings/matrix-sdk-crypto-js/tests/machine.test.js @@ -802,10 +802,10 @@ describe(OlmMachine.name, () => { expect(outgoingVerificationRequest.room_id).toStrictEqual(room.toString()); expect(outgoingVerificationRequest.txn_id).toBeDefined(); expect(outgoingVerificationRequest.event_type).toStrictEqual('m.key.verification.start'); - expect(outgoingVerificationRequest.content).toBeDefined(); + expect(outgoingVerificationRequest.body).toBeDefined(); - const content = JSON.parse(outgoingVerificationRequest.content); - expect(content).toMatchObject({ + const body = JSON.parse(outgoingVerificationRequest.body); + expect(body).toMatchObject({ from_device: expect.any(String), method: 'm.sas.v1', key_agreement_protocols: [expect.any(String)],