@@ -22,7 +22,9 @@ use crate::cli::conversation_key::execute_conversation_key;
2222use crate :: cli:: dm_to_user:: execute_dm_to_user;
2323use crate :: cli:: get_dm:: execute_get_dm;
2424use crate :: cli:: get_dm_user:: execute_get_dm_user;
25- use crate :: cli:: last_trade_index:: execute_last_trade_index;
25+ use crate :: cli:: last_trade_index:: {
26+ execute_last_trade_index, execute_last_trade_index_private_key,
27+ } ;
2628use crate :: cli:: list_disputes:: execute_list_disputes;
2729use crate :: cli:: list_orders:: execute_list_orders;
2830use crate :: cli:: new_order:: execute_new_order;
@@ -200,9 +202,9 @@ pub enum Commands {
200202 /// Order id
201203 #[ arg( short, long) ]
202204 order_id : Uuid ,
203- /// Message to send
204- #[ arg( short, long) ]
205- message : String ,
205+ /// Message to send (spaces allowed; use quotes or multiple -m/--message)
206+ #[ arg( short, long, num_args = 1 .. ) ]
207+ message : Vec < String > ,
206208 } ,
207209 /// Send gift wrapped direct message to a user
208210 DmToUser {
@@ -212,9 +214,9 @@ pub enum Commands {
212214 /// Order id to get ephemeral keys
213215 #[ arg( short, long) ]
214216 order_id : Uuid ,
215- /// Message to send
216- #[ arg( short, long) ]
217- message : String ,
217+ /// Message to send (spaces allowed; use quotes or multiple -m/--message)
218+ #[ arg( short, long, num_args = 1 .. ) ]
219+ message : Vec < String > ,
218220 } ,
219221 /// Send fiat sent message to confirm payment to other user
220222 FiatSent {
@@ -282,9 +284,9 @@ pub enum Commands {
282284 /// Pubkey of the recipient
283285 #[ arg( short, long) ]
284286 pubkey : String ,
285- /// Message to send
286- #[ arg( short, long) ]
287- message : String ,
287+ /// Message to send (spaces allowed; use quotes or multiple -m/--message)
288+ #[ arg( short, long, num_args = 1 .. ) ]
289+ message : Vec < String > ,
288290 } ,
289291 /// Get the conversation key for direct messaging with a user
290292 ConversationKey {
@@ -294,6 +296,8 @@ pub enum Commands {
294296 } ,
295297 /// Get last trade index of user
296298 GetLastTradeIndex { } ,
299+ /// Get private key of last trade index public key
300+ GetLastTradePrivkey { } ,
297301 /// Request detailed information for specific orders
298302 OrdersInfo {
299303 /// Order IDs to request information for
@@ -460,28 +464,34 @@ impl Commands {
460464 Commands :: GetLastTradeIndex { } => {
461465 execute_last_trade_index ( & ctx. identity_keys , ctx. mostro_pubkey , ctx) . await
462466 }
467+ Commands :: GetLastTradePrivkey { } => execute_last_trade_index_private_key ( ctx) . await ,
463468 // DM commands with pubkey parsing
464469 Commands :: SendDm {
465470 pubkey,
466471 order_id,
467472 message,
468- } => execute_send_dm ( PublicKey :: from_str ( pubkey) ?, ctx, order_id, message) . await ,
473+ } => {
474+ let msg = message. join ( " " ) ;
475+ execute_send_dm ( PublicKey :: from_str ( pubkey) ?, ctx, order_id, & msg) . await
476+ }
469477 Commands :: DmToUser {
470478 pubkey,
471479 order_id,
472480 message,
473481 } => {
482+ let msg = message. join ( " " ) ;
474483 execute_dm_to_user (
475484 PublicKey :: from_str ( pubkey) ?,
476485 & ctx. client ,
477486 order_id,
478- message ,
487+ & msg ,
479488 & ctx. pool ,
480489 )
481490 . await
482491 }
483492 Commands :: AdmSendDm { pubkey, message } => {
484- execute_adm_send_dm ( PublicKey :: from_str ( pubkey) ?, ctx, message) . await
493+ let msg = message. join ( " " ) ;
494+ execute_adm_send_dm ( PublicKey :: from_str ( pubkey) ?, ctx, & msg) . await
485495 }
486496 Commands :: ConversationKey { pubkey } => {
487497 execute_conversation_key ( & ctx. trade_keys , PublicKey :: from_str ( pubkey) ?) . await
0 commit comments