From 7d9b968f1681b6e8cc4e5801ef8a9a5617acc0a6 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Tue, 3 Jun 2025 14:28:04 +0000 Subject: [PATCH] chore(cli): Add author read relays to discovery relays Signed-off-by: Awiteb --- src/cli/commands/issue/new.rs | 3 +++ src/cli/commands/reply.rs | 8 +++++--- src/cli/commands/repo/announce.rs | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/issue/new.rs b/src/cli/commands/issue/new.rs index cb4db9b..779b9ee 100644 --- a/src/cli/commands/issue/new.rs +++ b/src/cli/commands/issue/new.rs @@ -110,6 +110,9 @@ impl CommandRunner for NewArgs { client.add_relays(&naddrs.extract_relays()).await; let relays_list = client.user_relays_list(user_pubk).await?; + client + .add_relays(&utils::add_read_relays(relays_list.as_ref())) + .await; let (subject, content) = self.issue_content()?; let content_details = client.parse_content(&content).await; diff --git a/src/cli/commands/reply.rs b/src/cli/commands/reply.rs index df20bb8..a5dd608 100644 --- a/src/cli/commands/reply.rs +++ b/src/cli/commands/reply.rs @@ -101,6 +101,11 @@ impl CommandRunner for ReplyArgs { }; client.add_relays(&self.to.relays).await; + let relays_list = client.user_relays_list(user_pubk).await?; + let author_read_relays = + utils::add_read_relays(client.user_relays_list(user_pubk).await?.as_ref()); + client.add_relays(&author_read_relays).await; + let reply_to = client .fetch_event(Filter::new().id(self.to.event_id)) @@ -139,9 +144,6 @@ impl CommandRunner for ReplyArgs { .build(user_pubk); let event_id = event.id.expect("There is an id"); - let relays_list = client.user_relays_list(user_pubk).await?; - let author_read_relays = - utils::add_read_relays(client.user_relays_list(user_pubk).await?.as_ref()); let write_relays = [ relays, utils::add_write_relays(relays_list.as_ref()), diff --git a/src/cli/commands/repo/announce.rs b/src/cli/commands/repo/announce.rs index fe29a81..7c65030 100644 --- a/src/cli/commands/repo/announce.rs +++ b/src/cli/commands/repo/announce.rs @@ -86,6 +86,9 @@ impl CommandRunner for AnnounceArgs { let client = NostrClient::init(&options, &relays).await; let user_pubk = options.pubkey().await?; let relays_list = client.user_relays_list(user_pubk).await?; + client + .add_relays(&utils::add_read_relays(relays_list.as_ref())) + .await; if !self.maintainers.contains(&user_pubk) { self.maintainers.insert(0, user_pubk);