diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-31 16:28:04 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-31 16:38:45 +0100 |
| commit | 436ff29135e3deade80a6e53e53d74dddb613481 (patch) | |
| tree | 53c086492fd710f9f289c756ec511f8b3d3819f3 /src/bin | |
| parent | 9d4adb9afd591ccef8827902034378acd700c6f8 (diff) | |
fix: mention marker ~> q tag NIP-10 update
required for rust-nostr v0.43 update
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/git_remote_nostr/push.rs | 4 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/send.rs | 23 |
2 files changed, 14 insertions, 13 deletions
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( | |||
| 1209 | merged_patches | 1209 | merged_patches |
| 1210 | .iter() | 1210 | .iter() |
| 1211 | .map(|merged_patch| { | 1211 | .map(|merged_patch| { |
| 1212 | Tag::from_standardized(nostr::TagStandard::Event { | 1212 | Tag::from_standardized(nostr::TagStandard::Quote { |
| 1213 | event_id: *merged_patch, | 1213 | event_id: *merged_patch, |
| 1214 | relay_url: repo_ref.relays.first().cloned(), | 1214 | relay_url: repo_ref.relays.first().cloned(), |
| 1215 | marker: Some(Marker::Mention), | ||
| 1216 | public_key: None, | 1215 | public_key: None, |
| 1217 | uppercase: false, | ||
| 1218 | }) | 1216 | }) |
| 1219 | }) | 1217 | }) |
| 1220 | .collect::<Vec<Tag>>(), | 1218 | .collect::<Vec<Tag>>(), |
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}; | |||
| 4 | use console::Style; | 4 | use console::Style; |
| 5 | use ngit::{ | 5 | use 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 | }; | ||
| 9 | use nostr::{ | ||
| 10 | ToBech32, | ||
| 11 | nips::{nip10::Marker, nip19::Nip19Event}, | ||
| 12 | }; | 8 | }; |
| 9 | use nostr::{ToBech32, nips::nip19::Nip19Event}; | ||
| 13 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | 10 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; |
| 14 | 11 | ||
| 15 | use crate::{ | 12 | use 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 | } |