diff options
Diffstat (limited to 'src/sub_commands/send.rs')
| -rw-r--r-- | src/sub_commands/send.rs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 35c2c81..d9caf9b 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -5,9 +5,10 @@ use console::Style; | |||
| 5 | use futures::future::join_all; | 5 | use futures::future::join_all; |
| 6 | use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; | 6 | use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; |
| 7 | use nostr::{ | 7 | use nostr::{ |
| 8 | nips::nip19::Nip19, prelude::sha1::Hash as Sha1Hash, EventBuilder, FromBech32, Marker, Tag, | 8 | nips::{nip01::Coordinate, nip19::Nip19}, |
| 9 | TagKind, UncheckedUrl, | 9 | EventBuilder, FromBech32, Marker, Tag, TagKind, UncheckedUrl, |
| 10 | }; | 10 | }; |
| 11 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | ||
| 11 | 12 | ||
| 12 | use super::list::tag_value; | 13 | use super::list::tag_value; |
| 13 | #[cfg(not(test))] | 14 | #[cfg(not(test))] |
| @@ -541,11 +542,13 @@ pub fn generate_cover_letter_and_patch_events( | |||
| 541 | vec![ | 542 | vec![ |
| 542 | // TODO: why not tag all maintainer identifiers? | 543 | // TODO: why not tag all maintainer identifiers? |
| 543 | Tag::A { | 544 | Tag::A { |
| 544 | kind: nostr::Kind::Custom(REPO_REF_KIND), | 545 | coordinate: Coordinate { |
| 545 | public_key: *repo_ref.maintainers.first() | 546 | kind: nostr::Kind::Custom(REPO_REF_KIND), |
| 546 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") | 547 | public_key: *repo_ref.maintainers.first() |
| 547 | ?, | 548 | .context("repo reference should always have at least one maintainer")?, |
| 548 | identifier: repo_ref.identifier.to_string(), | 549 | identifier: repo_ref.identifier.to_string(), |
| 550 | relays: repo_ref.relays.clone(), | ||
| 551 | }, | ||
| 549 | relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(), | 552 | relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(), |
| 550 | }, | 553 | }, |
| 551 | Tag::Reference(format!("{root_commit}")), | 554 | Tag::Reference(format!("{root_commit}")), |
| @@ -797,11 +800,14 @@ pub fn generate_patch_event( | |||
| 797 | [ | 800 | [ |
| 798 | vec![ | 801 | vec![ |
| 799 | Tag::A { | 802 | Tag::A { |
| 800 | kind: nostr::Kind::Custom(REPO_REF_KIND), | 803 | coordinate: Coordinate { |
| 801 | public_key: *repo_ref.maintainers.first() | 804 | kind: nostr::Kind::Custom(REPO_REF_KIND), |
| 802 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") | 805 | public_key: *repo_ref.maintainers.first() |
| 803 | ?, | 806 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") |
| 804 | identifier: repo_ref.identifier.to_string(), | 807 | ?, |
| 808 | identifier: repo_ref.identifier.to_string(), | ||
| 809 | relays: repo_ref.relays.clone(), | ||
| 810 | }, | ||
| 805 | relay_url: relay_hint.clone(), | 811 | relay_url: relay_hint.clone(), |
| 806 | }, | 812 | }, |
| 807 | Tag::Reference(format!("{root_commit}")), | 813 | Tag::Reference(format!("{root_commit}")), |