summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar grunfink2026-02-14 05:42:45 +0100
committerGravatar grunfink2026-02-14 05:42:45 +0100
commitebcdb748659407fd9038ada847e065cabe950a16 (patch)
tree4005474aceffbc552f3904256e1547c189c47f99
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-ebcdb748659407fd9038ada847e065cabe950a16.tar.gz
snac2-ebcdb748659407fd9038ada847e065cabe950a16.tar.xz
snac2-ebcdb748659407fd9038ada847e065cabe950a16.zip
Use the 'url' link instead of 'id' (if there is one) in html_actor_icon().
-rw-r--r--html.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/html.c b/html.c
index 3201904..7651fcb 100644
--- a/html.c
+++ b/html.c
@@ -274,6 +274,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
274 avatar = xs_fmt("data:image/png;base64, %s", default_avatar_base64()); 274 avatar = xs_fmt("data:image/png;base64, %s", default_avatar_base64());
275 275
276 const char *actor_id = xs_dict_get(actor, "id"); 276 const char *actor_id = xs_dict_get(actor, "id");
277 const char *html_url = xs_dict_get_def(actor, "url", actor_id);
277 xs *href = NULL; 278 xs *href = NULL;
278 279
279 if (user) { 280 if (user) {
@@ -287,7 +288,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
287 } 288 }
288 289
289 if (href == NULL) 290 if (href == NULL)
290 href = xs_dup(actor_id); 291 href = xs_dup(html_url);
291 292
292 xs_html *name_link = xs_html_tag("a", 293 xs_html *name_link = xs_html_tag("a",
293 xs_html_attr("href", href), 294 xs_html_attr("href", href),
@@ -453,7 +454,7 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
453 xs_html_add(actor_icon, 454 xs_html_add(actor_icon,
454 xs_html_sctag("br", NULL), 455 xs_html_sctag("br", NULL),
455 xs_html_tag("a", 456 xs_html_tag("a",
456 xs_html_attr("href", xs_dict_get(actor, "id")), 457 xs_html_attr("href", html_url),
457 xs_html_attr("class", "p-author-tag h-card snac-author-tag"), 458 xs_html_attr("class", "p-author-tag h-card snac-author-tag"),
458 xs_html_text(user))); 459 xs_html_text(user)));
459 } 460 }