Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3488302
D6460.id21558.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
675 B
Referenced Files
None
Subscribers
None
D6460.id21558.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D6460: [keyserver] Adding Tunnelbroker-client napi-rs publish class method
Attached
Detach File
Event Timeline
Log In to Comment