X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/3be1c24b1b18115becfaef1e2ea82c914a1fefea..f9a36c6e0404d06bd396b24b5ea699e49ed29b89:/client/src/jsonrpc.rs diff --git a/client/src/jsonrpc.rs b/client/src/jsonrpc.rs index cb1b4f8c..66ef9d9d 100644 --- a/client/src/jsonrpc.rs +++ b/client/src/jsonrpc.rs @@ -45,7 +45,24 @@ pub trait Rpc { account: Option, id: String, recipient: Option, - group_id: Option, + #[allow(non_snake_case)] groupId: Option, + ) -> Result; + + #[method(name = "getAvatar", param_kind = map)] + fn get_avatar( + &self, + account: Option, + contact: Option, + profile: Option, + #[allow(non_snake_case)] groupId: Option, + ) -> Result; + + #[method(name = "getSticker", param_kind = map)] + fn get_sticker( + &self, + account: Option, + #[allow(non_snake_case)] packId: String, + #[allow(non_snake_case)] stickerId: u32, ) -> Result; #[method(name = "getUserStatus", param_kind = map)] @@ -53,6 +70,7 @@ pub trait Rpc { &self, account: Option, recipients: Vec, + usernames: Vec, ) -> Result; #[method(name = "joinGroup", param_kind = map)] @@ -165,6 +183,7 @@ pub trait Rpc { endSession: bool, message: String, attachments: Vec, + viewOnce: bool, mentions: Vec, textStyle: Vec, quoteTimestamp: Option, @@ -173,10 +192,10 @@ pub trait Rpc { quoteMention: Vec, quoteTextStyle: Vec, quoteAttachment: Vec, - preview_url: Option, - preview_title: Option, - preview_description: Option, - preview_image: Option, + previewUrl: Option, + previewTitle: Option, + previewDescription: Option, + previewImage: Option, sticker: Option, storyTimestamp: Option, storyAuthor: Option, @@ -230,6 +249,15 @@ pub trait Rpc { stop: bool, ) -> Result; + #[method(name = "sendMessageRequestResponse", param_kind = map)] + fn send_message_request_response( + &self, + account: Option, + recipients: Vec, + #[allow(non_snake_case)] groupIds: Vec, + r#type: String, + ) -> Result; + #[method(name = "setPin", param_kind = map)] fn set_pin(&self, account: Option, pin: String) -> Result; @@ -284,6 +312,8 @@ pub trait Rpc { account: Option, deviceName: Option, unrestrictedUnidentifiedSender: Option, + discoverableByNumber: Option, + numberSharing: Option, ) -> Result; #[method(name = "updateConfiguration", param_kind = map)] @@ -381,6 +411,7 @@ pub async fn connect_tcp( Ok(ClientBuilder::default().build_with_tokio(sender, receiver)) } +#[cfg(unix)] pub async fn connect_unix( socket_path: impl AsRef, ) -> Result { @@ -389,6 +420,6 @@ pub async fn connect_unix( Ok(ClientBuilder::default().build_with_tokio(sender, receiver)) } -pub async fn connect_http(uri: &str) -> Result { +pub async fn connect_http(uri: &str) -> Result, Error> { HttpClientBuilder::default().build(uri) }