From 55a4868813d3fe8f4437dc7d527cfa8ba7c3966a Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Tue, 27 May 2025 08:29:13 +0000
Subject: [PATCH] fix(utils-repo_naddr): Create a valid naddr string
Signed-off-by: Awiteb
---
src/nostr_utils/utils.rs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/nostr_utils/utils.rs b/src/nostr_utils/utils.rs
index 6524967..485bacd 100644
--- a/src/nostr_utils/utils.rs
+++ b/src/nostr_utils/utils.rs
@@ -126,9 +126,13 @@ pub fn new_nevent(event_id: EventId, relays: &[RelayUrl]) -> N34Result {
/// Creates a NIP-19 naddr string for a git repository announcement and up to 3
/// unique relay URLs.
-pub fn repo_naddr(pubk: PublicKey, relays: &[RelayUrl]) -> N34Result {
+pub fn repo_naddr(
+ repo_id: impl Into,
+ pubk: PublicKey,
+ relays: &[RelayUrl],
+) -> N34Result {
Nip19Coordinate::new(
- Coordinate::new(Kind::GitRepoAnnouncement, pubk),
+ Coordinate::new(Kind::GitRepoAnnouncement, pubk).identifier(repo_id),
dedup(relays.iter().cloned()).iter().take(3),
)
.expect("Valid relays")