diff options
Diffstat (limited to 'src/sub_commands')
| -rw-r--r-- | src/sub_commands/list.rs | 12 | ||||
| -rw-r--r-- | src/sub_commands/send.rs | 31 |
2 files changed, 29 insertions, 14 deletions
diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index 2d81164..1a30b9b 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs | |||
| @@ -730,9 +730,12 @@ pub async fn find_proposal_events( | |||
| 730 | vec![ | 730 | vec![ |
| 731 | nostr::Filter::default() | 731 | nostr::Filter::default() |
| 732 | .kind(nostr::Kind::Custom(PATCH_KIND)) | 732 | .kind(nostr::Kind::Custom(PATCH_KIND)) |
| 733 | .custom_tag(nostr::Alphabet::T, vec!["root"]) | ||
| 734 | .custom_tag( | 733 | .custom_tag( |
| 735 | nostr::Alphabet::A, | 734 | nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), |
| 735 | vec!["root"], | ||
| 736 | ) | ||
| 737 | .custom_tag( | ||
| 738 | nostr::SingleLetterTag::lowercase(nostr::Alphabet::A), | ||
| 736 | repo_ref | 739 | repo_ref |
| 737 | .maintainers | 740 | .maintainers |
| 738 | .iter() | 741 | .iter() |
| @@ -742,7 +745,10 @@ pub async fn find_proposal_events( | |||
| 742 | // events | 745 | // events |
| 743 | nostr::Filter::default() | 746 | nostr::Filter::default() |
| 744 | .kind(nostr::Kind::Custom(PATCH_KIND)) | 747 | .kind(nostr::Kind::Custom(PATCH_KIND)) |
| 745 | .custom_tag(nostr::Alphabet::T, vec!["root"]) | 748 | .custom_tag( |
| 749 | nostr::SingleLetterTag::lowercase(nostr::Alphabet::T), | ||
| 750 | vec!["root"], | ||
| 751 | ) | ||
| 746 | .reference(root_commit), | 752 | .reference(root_commit), |
| 747 | ], | 753 | ], |
| 748 | ) | 754 | ) |
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index cc182f1..91654d2 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -4,7 +4,10 @@ use anyhow::{bail, Context, Result}; | |||
| 4 | use console::Style; | 4 | 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::{nips::nip19::Nip19, EventBuilder, FromBech32, Marker, Tag, TagKind, UncheckedUrl}; | 7 | use nostr::{ |
| 8 | nips::{nip01::Coordinate, nip19::Nip19}, | ||
| 9 | EventBuilder, FromBech32, Marker, Tag, TagKind, UncheckedUrl, | ||
| 10 | }; | ||
| 8 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | 11 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; |
| 9 | 12 | ||
| 10 | use super::list::tag_value; | 13 | use super::list::tag_value; |
| @@ -539,11 +542,14 @@ pub fn generate_cover_letter_and_patch_events( | |||
| 539 | vec![ | 542 | vec![ |
| 540 | // TODO: why not tag all maintainer identifiers? | 543 | // TODO: why not tag all maintainer identifiers? |
| 541 | Tag::A { | 544 | Tag::A { |
| 542 | kind: nostr::Kind::Custom(REPO_REF_KIND), | 545 | coordinate: Coordinate { |
| 543 | public_key: *repo_ref.maintainers.first() | 546 | kind: nostr::Kind::Custom(REPO_REF_KIND), |
| 544 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") | 547 | public_key: *repo_ref.maintainers.first() |
| 545 | ?, | 548 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") |
| 546 | identifier: repo_ref.identifier.to_string(), | 549 | ?, |
| 550 | identifier: repo_ref.identifier.to_string(), | ||
| 551 | relays: repo_ref.relays.clone(), | ||
| 552 | }, | ||
| 547 | relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(), | 553 | relay_url: repo_ref.relays.first().map(nostr::UncheckedUrl::from).clone(), |
| 548 | }, | 554 | }, |
| 549 | Tag::Reference(format!("{root_commit}")), | 555 | Tag::Reference(format!("{root_commit}")), |
| @@ -795,11 +801,14 @@ pub fn generate_patch_event( | |||
| 795 | [ | 801 | [ |
| 796 | vec![ | 802 | vec![ |
| 797 | Tag::A { | 803 | Tag::A { |
| 798 | kind: nostr::Kind::Custom(REPO_REF_KIND), | 804 | coordinate: Coordinate { |
| 799 | public_key: *repo_ref.maintainers.first() | 805 | kind: nostr::Kind::Custom(REPO_REF_KIND), |
| 800 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") | 806 | public_key: *repo_ref.maintainers.first() |
| 801 | ?, | 807 | .context("repo reference should always have at least one maintainer - the issuer of the repo event") |
| 802 | identifier: repo_ref.identifier.to_string(), | 808 | ?, |
| 809 | identifier: repo_ref.identifier.to_string(), | ||
| 810 | relays: repo_ref.relays.clone(), | ||
| 811 | }, | ||
| 803 | relay_url: relay_hint.clone(), | 812 | relay_url: relay_hint.clone(), |
| 804 | }, | 813 | }, |
| 805 | Tag::Reference(format!("{root_commit}")), | 814 | Tag::Reference(format!("{root_commit}")), |