Skip to content

Commit f9ae2ac

Browse files
committed
feat: new message for taker with user info
1 parent 9cf9345 commit f9ae2ac

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/cli/new_order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub async fn execute_new_order(
8484
);
8585

8686
// Create new order for mostro
87-
let order_content = Payload::Order(small_order.clone());
87+
let order_content = Payload::Order(small_order.clone(), None);
8888

8989
// Print order preview
9090
let ord_preview = print_order_preview(order_content.clone())

src/parser/dms.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ fn format_payload_details(payload: &Payload, action: &Action) -> String {
8787
format!("⚡ Lightning Invoice:\n{}", inv)
8888
}
8989
Payload::Dispute(id, _) => format!("⚖️ Dispute ID: {}", id),
90-
Payload::Order(o) if *action == Action::NewOrder => format!(
90+
Payload::Order(o, _) if *action == Action::NewOrder => format!(
9191
"🆕 New Order: {} {} sats ({})",
9292
o.id.as_ref()
9393
.map(|x| x.to_string())
9494
.unwrap_or_else(|| "N/A".to_string()),
9595
o.amount,
9696
o.fiat_code
9797
),
98-
Payload::Order(o) => {
98+
Payload::Order(o, _) => {
9999
// Pretty format order details
100100
let status_emoji = match o.status.as_ref().unwrap_or(&Status::Pending) {
101101
Status::Pending => "⏳",
@@ -381,7 +381,7 @@ pub async fn print_commands_results(message: &MessageKind, ctx: &Context) -> Res
381381
// Do the logic for the message response
382382
match message.action {
383383
Action::NewOrder => {
384-
if let Some(Payload::Order(order)) = message.payload.as_ref() {
384+
if let Some(Payload::Order(order, _)) = message.payload.as_ref() {
385385
if let Some(req_id) = message.request_id {
386386
if let Err(e) = save_order(
387387
order.clone(),
@@ -430,7 +430,7 @@ pub async fn print_commands_results(message: &MessageKind, ctx: &Context) -> Res
430430
}
431431
// this is the case where the buyer adds an invoice to a takesell order
432432
Action::AddInvoice => {
433-
if let Some(Payload::Order(order)) = &message.payload {
433+
if let Some(Payload::Order(order, _)) = &message.payload {
434434
handle_add_invoice_display(order);
435435

436436
if let Some(req_id) = message.request_id {

src/parser/orders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn parse_orders_events(
7676

7777
pub fn print_order_preview(ord: Payload) -> Result<String, String> {
7878
let single_order = match ord {
79-
Payload::Order(o) => o,
79+
Payload::Order(o, _) => o,
8080
_ => return Err("Error".to_string()),
8181
};
8282

src/util/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn uppercase_first(s: &str) -> String {
1010

1111
pub fn get_mcli_path() -> String {
1212
let home_dir = dirs::home_dir().expect("Couldn't get home directory");
13-
let mcli_path = format!("{}/.mcli", home_dir.display());
13+
let mcli_path = format!("{}/.mcliUserA", home_dir.display());
1414
if !Path::new(&mcli_path).exists() {
1515
match fs::create_dir(&mcli_path) {
1616
Ok(_) => println!("Directory {} created.", mcli_path),

0 commit comments

Comments
 (0)