fix(forge): review fixes for the forgejo-api port
This commit is contained in:
parent
5cfb33eeed
commit
261f02439b
6 changed files with 57 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue