From 436ff29135e3deade80a6e53e53d74dddb613481 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 31 Jul 2025 16:28:04 +0100 Subject: fix: mention marker ~> q tag NIP-10 update required for rust-nostr v0.43 update --- src/bin/git_remote_nostr/push.rs | 4 +--- src/bin/ngit/sub_commands/send.rs | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src/bin') diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index 73d76b4..9ba7c30 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -1209,12 +1209,10 @@ async fn create_merge_status( merged_patches .iter() .map(|merged_patch| { - Tag::from_standardized(nostr::TagStandard::Event { + Tag::from_standardized(nostr::TagStandard::Quote { event_id: *merged_patch, relay_url: repo_ref.relays.first().cloned(), - marker: Some(Marker::Mention), public_key: None, - uppercase: false, }) }) .collect::>(), 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}; use console::Style; use ngit::{ client::{Params, send_events}, - git_events::generate_cover_letter_and_patch_events, -}; -use nostr::{ - ToBech32, - nips::{nip10::Marker, nip19::Nip19Event}, + git_events::{EventRefType, generate_cover_letter_and_patch_events}, }; +use nostr::{ToBech32, nips::nip19::Nip19Event}; use nostr_sdk::hashes::sha1::Hash as Sha1Hash; use crate::{ @@ -368,7 +365,7 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to( in_reply_to: &[String], ) -> Result<(Option, Vec)> { let root_proposal_id = if let Some(first) = in_reply_to.first() { - match event_tag_from_nip19_or_hex(first, "in-reply-to", Marker::Root, true, false)? + match event_tag_from_nip19_or_hex(first, "in-reply-to", EventRefType::Root, true, false)? .as_standardized() { Some(nostr_sdk::TagStandard::Event { @@ -404,10 +401,16 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to( for (i, reply_to) in in_reply_to.iter().enumerate() { if i.ne(&0) || root_proposal_id.is_none() { mention_tags.push( - event_tag_from_nip19_or_hex(reply_to, "in-reply-to", Marker::Mention, true, false) - .context(format!( - "{reply_to} in 'in-reply-to' not a valid nostr reference" - ))?, + event_tag_from_nip19_or_hex( + reply_to, + "in-reply-to", + EventRefType::Quote, + true, + false, + ) + .context(format!( + "{reply_to} in 'in-reply-to' not a valid nostr reference" + ))?, ); } } -- cgit v1.2.3