From 3b4f0b0eee124133b641d6770704c368712f3dff Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 23 May 2024 14:44:39 +0100 Subject: feat: add NIP-31 alt tags to repo announcements, patches and cover letters --- src/repo_ref.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/repo_ref.rs') diff --git a/src/repo_ref.rs b/src/repo_ref.rs index 3e8db64..d314e6d 100644 --- a/src/repo_ref.rs +++ b/src/repo_ref.rs @@ -136,6 +136,10 @@ impl RepoRef { .map(std::string::ToString::to_string) .collect(), ), + Tag::Generic( + nostr::TagKind::Custom("alt".to_string()), + vec![format!("git repository: {}", self.name.clone())], + ), ], // code languages and hashtags ] @@ -451,6 +455,15 @@ mod tests { .any(|t| t.as_vec()[0].eq("name") && t.as_vec()[1].eq("test name")) ) } + + #[test] + fn alt() { + assert!( + create().tags.iter().any(|t| t.as_vec()[0].eq("alt") + && t.as_vec()[1].eq("git repository: test name")) + ) + } + #[test] fn description() { assert!(create().tags.iter().any( @@ -515,7 +528,7 @@ mod tests { #[test] fn no_other_tags() { - assert_eq!(create().tags.len(), 8) + assert_eq!(create().tags.len(), 9) } } } -- cgit v1.2.3