Skip to content

Commit

Permalink
Include dispute id on dispute start (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch authored Aug 18, 2024
1 parent 12f14bb commit 97609c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 10 additions & 4 deletions src/app/dispute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 97609c1

Please sign in to comment.