From 3112576195aef212622d27ad9164336796c1953e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 13 Feb 2024 06:27:34 +0000 Subject: feat(prs-create)!: pr to nip34-like cover letter up the pr event type to a nip34-like cover letter format this sets the building blocks in place to enable simplier clients to use the 'cover letter' feature in `git format-patch` to create the experience as a pr event --- src/sub_commands/pull.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/sub_commands/pull.rs') diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs index c426510..f3ae81f 100644 --- a/src/sub_commands/pull.rs +++ b/src/sub_commands/pull.rs @@ -8,6 +8,7 @@ use crate::{ client::Connect, git::{Repo, RepoActions}, repo_ref, + repo_ref::REPO_REF_KIND, sub_commands::prs::{ create::{PATCH_KIND, PR_KIND}, list::{get_most_recent_patch_with_ancestors, tag_value}, @@ -53,7 +54,12 @@ pub async fn launch() -> Result<()> { vec![ nostr::Filter::default() .kind(nostr::Kind::Custom(PR_KIND)) - .reference(format!("r-{root_commit}")), + .identifiers( + repo_ref + .maintainers + .iter() + .map(|m| format!("{REPO_REF_KIND}:{m}:{}", repo_ref.identifier)), + ), ], ) .await? @@ -62,7 +68,7 @@ pub async fn launch() -> Result<()> { e.kind.as_u64() == PR_KIND && e.tags .iter() - .any(|t| t.as_vec().len() > 1 && t.as_vec()[1].eq(&format!("r-{root_commit}"))) + .any(|t| t.as_vec().len() > 1 && t.as_vec()[1].eq(&format!("{root_commit}"))) && tag_value(e, "branch-name") .unwrap_or_default() .eq(&branch_name) -- cgit v1.2.3