X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/7cf3a989bf47dd81f8700dcfb6986ac81e1bf02e..ff846bc6784f1245bc2b1c83651fea3b673c563a:/client/src/main.rs diff --git a/client/src/main.rs b/client/src/main.rs index 61cbabf2..68de03d4 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -2,7 +2,7 @@ use std::{path::PathBuf, time::Duration}; use clap::Parser; use jsonrpsee::core::client::{Error as RpcError, Subscription, SubscriptionClientT}; -use serde_json::Value; +use serde_json::{Error, Value}; use tokio::{select, time::sleep}; use cli::Cli; @@ -70,7 +70,7 @@ async fn handle_command( .await .map_err(|e| RpcError::Custom(format!("JSON-RPC command startLink failed: {e:?}")))? .device_link_uri; - println!("{}", url); + println!("{url}"); client.finish_link(url, name).await } CliCommands::ListAccounts => client.list_accounts().await, @@ -275,9 +275,17 @@ async fn handle_command( CliCommands::UpdateAccount { device_name, unrestricted_unidentified_sender, + discoverable_by_number, + number_sharing, } => { client - .update_account(cli.account, device_name, unrestricted_unidentified_sender) + .update_account( + cli.account, + device_name, + unrestricted_unidentified_sender, + discoverable_by_number, + number_sharing, + ) .await } CliCommands::UpdateConfiguration { @@ -429,6 +437,23 @@ async fn handle_command( .start_change_number(cli.account, number, voice, captcha) .await } + CliCommands::SendMessageRequestResponse { + recipient, + group_id, + r#type, + } => { + client + .send_message_request_response( + cli.account, + recipient, + group_id, + match r#type { + cli::MessageRequestResponseType::Accept => "accept".to_owned(), + cli::MessageRequestResponseType::Delete => "delete".to_owned(), + }, + ) + .await + } } } @@ -475,7 +500,7 @@ async fn connect(cli: Cli) -> Result { async fn stream_next( timeout: f64, stream: &mut Subscription, -) -> Option> { +) -> Option> { if timeout < 0.0 { stream.next().await } else {