From 2d15f758da69f672cdfbed6d3633f3fe882df48b Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 16 May 2022 15:12:23 +0200 Subject: [PATCH] feat(crypto): Use JavaScript naming style for methods. --- crates/matrix-sdk-crypto/src/js/machine.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/matrix-sdk-crypto/src/js/machine.rs b/crates/matrix-sdk-crypto/src/js/machine.rs index f02ffb3a2..e5d3d2fcb 100644 --- a/crates/matrix-sdk-crypto/src/js/machine.rs +++ b/crates/matrix-sdk-crypto/src/js/machine.rs @@ -27,27 +27,32 @@ impl OlmMachine { } /// The unique user ID that owns this `OlmMachine` instance. + #[wasm_bindgen(js_name = "userId")] pub fn user_id(&self) -> identifiers::UserId { identifiers::UserId { inner: self.inner.user_id().to_owned() } } /// The unique device ID that identifies this `OlmMachine`. + #[wasm_bindgen(js_name = "deviceId")] pub fn device_id(&self) -> identifiers::DeviceId { identifiers::DeviceId { inner: self.inner.device_id().to_owned() } } ///// Get the public parts of our Olm identity keys. + #[wasm_bindgen(js_name = "identityKeys")] pub fn identity_keys(&self) -> IdentityKeys { self.inner.identity_keys().into() } /// Get the display name of our own device. + #[wasm_bindgen(js_name = "displayName")] pub fn display_name(&self) -> Promise { let me = self.inner.clone(); future_to_promise(async move { Ok(me.display_name().await?) }) } + #[wasm_bindgen(js_name = "receiveSyncChanges")] pub fn receive_sync_changes( &self, to_device_events: &str, @@ -93,6 +98,7 @@ impl OlmMachine { })) } + #[wasm_bindgen(js_name = "outgoingRequests")] pub fn outgoing_requests(&self) -> Promise { let me = self.inner.clone();