]> nmode's Git Repositories - signal-cli/blobdiff - client/src/jsonrpc.rs
Add support for sending view once messages
[signal-cli] / client / src / jsonrpc.rs
index cb1b4f8c1985c32e6fb2d025d4ce07b166a75022..fe0dc668e879378f34824437f4fb16954361811c 100644 (file)
@@ -45,7 +45,24 @@ pub trait Rpc {
         account: Option<String>,
         id: String,
         recipient: Option<String>,
-        group_id: Option<String>,
+        #[allow(non_snake_case)] groupId: Option<String>,
+    ) -> Result<Value, ErrorObjectOwned>;
+
+    #[method(name = "getAvatar", param_kind = map)]
+    fn get_avatar(
+        &self,
+        account: Option<String>,
+        contact: Option<String>,
+        profile: Option<String>,
+        #[allow(non_snake_case)] groupId: Option<String>,
+    ) -> Result<Value, ErrorObjectOwned>;
+
+    #[method(name = "getSticker", param_kind = map)]
+    fn get_sticker(
+        &self,
+        account: Option<String>,
+        #[allow(non_snake_case)] packId: String,
+        #[allow(non_snake_case)] stickerId: u32,
     ) -> Result<Value, ErrorObjectOwned>;
 
     #[method(name = "getUserStatus", param_kind = map)]
@@ -53,6 +70,7 @@ pub trait Rpc {
         &self,
         account: Option<String>,
         recipients: Vec<String>,
+        usernames: Vec<String>,
     ) -> Result<Value, ErrorObjectOwned>;
 
     #[method(name = "joinGroup", param_kind = map)]
@@ -165,6 +183,7 @@ pub trait Rpc {
         endSession: bool,
         message: String,
         attachments: Vec<String>,
+        view_once: bool,
         mentions: Vec<String>,
         textStyle: Vec<String>,
         quoteTimestamp: Option<u64>,
@@ -230,6 +249,15 @@ pub trait Rpc {
         stop: bool,
     ) -> Result<Value, ErrorObjectOwned>;
 
+    #[method(name = "sendMessageRequestResponse", param_kind = map)]
+    fn send_message_request_response(
+        &self,
+        account: Option<String>,
+        recipients: Vec<String>,
+        #[allow(non_snake_case)] groupIds: Vec<String>,
+        r#type: String,
+    ) -> Result<Value, ErrorObjectOwned>;
+
     #[method(name = "setPin", param_kind = map)]
     fn set_pin(&self, account: Option<String>, pin: String) -> Result<Value, ErrorObjectOwned>;
 
@@ -284,6 +312,8 @@ pub trait Rpc {
         account: Option<String>,
         deviceName: Option<String>,
         unrestrictedUnidentifiedSender: Option<bool>,
+        discoverableByNumber: Option<bool>,
+        numberSharing: Option<bool>,
     ) -> Result<Value, ErrorObjectOwned>;
 
     #[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<Path>,
 ) -> Result<impl SubscriptionClientT, std::io::Error> {
@@ -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<impl SubscriptionClientT, Error> {
+pub async fn connect_http(uri: &str) -> Result<impl SubscriptionClientT + use<>, Error> {
     HttpClientBuilder::default().build(uri)
 }