commit ebcdb74

grunfink  ·  2026-02-14 04:42:45 +0000 UTC
parent 01c412d
Use the 'url' link instead of 'id' (if there is one) in html_actor_icon().
1 files changed,  +3, -2
M html.c
M html.c
+3, -2
 1@@ -274,6 +274,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
 2         avatar = xs_fmt("data:image/png;base64, %s", default_avatar_base64());
 3 
 4     const char *actor_id = xs_dict_get(actor, "id");
 5+    const char *html_url = xs_dict_get_def(actor, "url", actor_id);
 6     xs *href = NULL;
 7 
 8     if (user) {
 9@@ -287,7 +288,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
10     }
11 
12     if (href == NULL)
13-        href = xs_dup(actor_id);
14+        href = xs_dup(html_url);
15 
16     xs_html *name_link = xs_html_tag("a",
17             xs_html_attr("href",    href),
18@@ -453,7 +454,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
19         xs_html_add(actor_icon,
20             xs_html_sctag("br", NULL),
21             xs_html_tag("a",
22-                xs_html_attr("href",  xs_dict_get(actor, "id")),
23+                xs_html_attr("href",  html_url),
24                 xs_html_attr("class", "p-author-tag h-card snac-author-tag"),
25                 xs_html_text(user)));
26     }