upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-07-31 16:28:04 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-07-31 16:38:45 +0100
commit436ff29135e3deade80a6e53e53d74dddb613481 (patch)
tree53c086492fd710f9f289c756ec511f8b3d3819f3 /src/bin/ngit
parent9d4adb9afd591ccef8827902034378acd700c6f8 (diff)
fix: mention marker ~> q tag NIP-10 update
required for rust-nostr v0.43 update
Diffstat (limited to 'src/bin/ngit')
-rw-r--r--src/bin/ngit/sub_commands/send.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs
index c84e339..8b49e37 100644
--- a/src/bin/ngit/sub_commands/send.rs
+++ b/src/bin/ngit/sub_commands/send.rs
@@ -4,12 +4,9 @@ use anyhow::{Context, Result, bail};
4use console::Style; 4use console::Style;
5use ngit::{ 5use ngit::{
6 client::{Params, send_events}, 6 client::{Params, send_events},
7 git_events::generate_cover_letter_and_patch_events, 7 git_events::{EventRefType, generate_cover_letter_and_patch_events},
8};
9use nostr::{
10 ToBech32,
11 nips::{nip10::Marker, nip19::Nip19Event},
12}; 8};
9use nostr::{ToBech32, nips::nip19::Nip19Event};
13use nostr_sdk::hashes::sha1::Hash as Sha1Hash; 10use nostr_sdk::hashes::sha1::Hash as Sha1Hash;
14 11
15use crate::{ 12use crate::{
@@ -368,7 +365,7 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to(
368 in_reply_to: &[String], 365 in_reply_to: &[String],
369) -> Result<(Option<String>, Vec<nostr::Tag>)> { 366) -> Result<(Option<String>, Vec<nostr::Tag>)> {
370 let root_proposal_id = if let Some(first) = in_reply_to.first() { 367 let root_proposal_id = if let Some(first) = in_reply_to.first() {
371 match event_tag_from_nip19_or_hex(first, "in-reply-to", Marker::Root, true, false)? 368 match event_tag_from_nip19_or_hex(first, "in-reply-to", EventRefType::Root, true, false)?
372 .as_standardized() 369 .as_standardized()
373 { 370 {
374 Some(nostr_sdk::TagStandard::Event { 371 Some(nostr_sdk::TagStandard::Event {
@@ -404,10 +401,16 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to(
404 for (i, reply_to) in in_reply_to.iter().enumerate() { 401 for (i, reply_to) in in_reply_to.iter().enumerate() {
405 if i.ne(&0) || root_proposal_id.is_none() { 402 if i.ne(&0) || root_proposal_id.is_none() {
406 mention_tags.push( 403 mention_tags.push(
407 event_tag_from_nip19_or_hex(reply_to, "in-reply-to", Marker::Mention, true, false) 404 event_tag_from_nip19_or_hex(
408 .context(format!( 405 reply_to,
409 "{reply_to} in 'in-reply-to' not a valid nostr reference" 406 "in-reply-to",
410 ))?, 407 EventRefType::Quote,
408 true,
409 false,
410 )
411 .context(format!(
412 "{reply_to} in 'in-reply-to' not a valid nostr reference"
413 ))?,
411 ); 414 );
412 } 415 }
413 } 416 }