From b3b7ce7a4be374927b8fdd5db419d5d3cd87eb1f Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Tue, 20 May 2025 11:33:12 +0000
Subject: [PATCH] chore(repo-announce): Ensure that the event author is not a
duplicate maintainer
Signed-off-by: Awiteb
---
src/cli/repo/announce.rs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/cli/repo/announce.rs b/src/cli/repo/announce.rs
index 82dab92..1b487a9 100644
--- a/src/cli/repo/announce.rs
+++ b/src/cli/repo/announce.rs
@@ -51,13 +51,15 @@ pub struct AnnounceArgs {
}
impl CommandRunner for AnnounceArgs {
- async fn run(self, options: CliOptions) -> N34Result<()> {
+ async fn run(mut self, options: CliOptions) -> N34Result<()> {
let client = NostrClient::init(&options).await;
let user_pubk = options.pubkey().await?;
let relays_list = client.user_relays_list(user_pubk).await?;
let write_relays = utils::add_write_relays(options.relays.clone(), relays_list.as_ref());
- let mut maintainers = vec![user_pubk];
- maintainers.extend(self.maintainers);
+
+ if !self.maintainers.contains(&user_pubk) {
+ self.maintainers.insert(0, user_pubk);
+ }
let event = EventBuilder::new_git_repo(
self.repo_id,
@@ -66,7 +68,7 @@ impl CommandRunner for AnnounceArgs {
self.web,
self.clone,
options.relays.clone(),
- maintainers,
+ self.maintainers,
self.label.into_iter().map(utils::str_trim).collect(),
)?
.pow(options.pow)