feat: Add alt tag to the git issue

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-06-04 22:05:21 +00:00
parent 16e6300c81
commit 494cced9cb
4 changed files with 22 additions and 11 deletions

View File

@@ -28,6 +28,7 @@ use nostr::{
types::{RelayUrl, Url},
};
use crate::cli::issue::ISSUE_ALT_PREFIX;
use crate::error::{N34Error, N34Result};
@@ -115,13 +116,20 @@ impl EventBuilder {
subject: Option<String>,
labels: Vec<String>,
) -> N34Result<EventBuilder> {
EventBuilder::git_issue(GitIssue {
let mut event_builder = EventBuilder::git_issue(GitIssue {
repository,
content,
subject,
subject: subject.clone(),
labels: labels.into_iter().map(|l| l.trim().to_owned()).collect(),
})
.map_err(N34Error::from)
.map_err(N34Error::from)?;
if let Some(issue_subject) = subject {
event_builder =
event_builder.tag(Tag::alt(format!("{ISSUE_ALT_PREFIX}{issue_subject}")))
}
Ok(event_builder)
}
}