Page MenuHomePhabricator

D6460.diff
No OneTemporary

D6460.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
@@ -64,4 +64,23 @@
});
TunnelbrokerClient { tx }
}
+
+ #[napi]
+ pub async fn publish(
+ &self,
+ to_device_id: String,
+ payload: String,
+ ) -> napi::Result<()> {
+ let messages =
+ vec![tunnelbroker::tunnelbroker_pb::MessageToTunnelbrokerStruct {
+ to_device_id,
+ payload,
+ blob_hashes: vec![],
+ }];
+
+ if let Err(_) = tunnelbroker::publish_messages(&self.tx, messages).await {
+ return Err(napi::Error::from_status(napi::Status::GenericFailure));
+ }
+ Ok(())
+ }
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 7:12 AM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675824
Default Alt Text
D6460.diff (817 B)

Event Timeline