From 97609c112255d61cd25deb8d9d68f3d6de49aa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Sun, 18 Aug 2024 11:28:36 -0300 Subject: [PATCH] Include dispute id on dispute start (#343) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/app/dispute.rs | 14 ++++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3332118..477e1c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1861,9 +1861,9 @@ dependencies = [ [[package]] name = "mostro-core" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745caf98f0ee5291f008f9b8896463b6319b861ab0eb1688e11180af5d89489b" +checksum = "d998fc6d189bb2725cac202c77ddea7a591955f0c0fc9b3b8941a95a75bceec2" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 4cca3cd..33a2077 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ uuid = { version = "1.8.0", features = [ "serde", ] } reqwest = { version = "0.12.1", features = ["json"] } -mostro-core = { version = "0.6.4", features = ["sqlx"] } +mostro-core = { version = "0.6.5", features = ["sqlx"] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } config = "0.14.0" diff --git a/src/app/dispute.rs b/src/app/dispute.rs index a6b8bbf..957a282 100644 --- a/src/app/dispute.rs +++ b/src/app/dispute.rs @@ -7,7 +7,7 @@ use crate::NOSTR_CLIENT; use anyhow::{Error, Result}; use mostro_core::dispute::Dispute; -use mostro_core::message::{Action, Message}; +use mostro_core::message::{Action, Content, Message}; use mostro_core::order::{Order, Status}; use nostr_sdk::prelude::*; use sqlx::{Pool, Sqlite}; @@ -38,7 +38,13 @@ pub async fn dispute_action( if matches!(st, Status::Active | Status::FiatSent) { order } else { - send_new_order_msg(Some(order.id), Action::NotAllowedByStatus, None, &event.pubkey).await; + send_new_order_msg( + Some(order.id), + Action::NotAllowedByStatus, + None, + &event.pubkey, + ) + .await; return Ok(()); } } else { @@ -114,7 +120,7 @@ pub async fn dispute_action( send_new_order_msg( Some(order_id), Action::DisputeInitiatedByYou, - None, + Some(Content::Dispute(dispute.clone().id)), &initiator_pubkey, ) .await; @@ -130,7 +136,7 @@ pub async fn dispute_action( send_new_order_msg( Some(order_id), Action::DisputeInitiatedByPeer, - None, + Some(Content::Dispute(dispute.clone().id)), &counterpart_pubkey, ) .await;