fix(forge): review fixes for the forgejo-api port

This commit is contained in:
müde 2026-07-07 14:42:43 +02:00
commit 261f02439b
6 changed files with 57 additions and 22 deletions

View file

@ -381,6 +381,10 @@ async fn format_notification(
let subj = notif.thread.subject.as_ref();
let title = subj.and_then(|s| s.title.as_deref()).unwrap_or("?");
let subject_type = subj.and_then(|s| s.r#type);
// forgejo-api maps a blank `html_url` (Go marshals empty strings) to
// `None`, so the API-url fallback also covers present-but-empty —
// deliberate: a fetchable API link beats the raw-HTTP predecessor's
// empty `url:` line.
let html_url = subj
.and_then(|s| s.html_url.as_ref().or(s.url.as_ref()))
.map_or("", url::Url::as_str);