Page MenuHomePhabricator

D6460.id21558.diff
No OneTemporary

D6460.id21558.diff

diff --git a/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs b/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
--- a/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
+++ b/keyserver/addons/rust-node-addon/src/tunnelbroker_client.rs
@@ -58,4 +58,18 @@
});
TunnelbrokerClient { tx }
}
+
+ #[napi]
+ pub async unsafe fn publish(
+ &mut self,
+ to_device_id: String,
+ payload: String,
+ ) -> napi::Result<()> {
+ if let Err(_) =
+ tunnelbroker::publish_message(&self.tx, to_device_id, payload).await
+ {
+ return Err(napi::Error::from_status(napi::Status::GenericFailure));
+ }
+ Ok(())
+ }
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 9:37 AM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676591
Default Alt Text
D6460.id21558.diff (675 B)

Event Timeline