commit e5cf958

grunfink  ·  2026-02-24 07:19:39 +0000 UTC
parent 97901eb
Also use the 'url' field in the » link to the post.
1 files changed,  +7, -2
M html.c
M html.c
+7, -2
 1@@ -483,9 +483,14 @@ xs_html *html_msg_icon(snac *user, const char *actor_id, const xs_dict *msg,
 2         const char *type = xs_dict_get(msg, "type");
 3         const int scope = get_msg_visibility(msg);
 4 
 5-        if (xs_match(type, POSTLIKE_OBJECT_TYPE))
 6-            url = xs_dict_get(msg, "id");
 7+        if (xs_match(type, POSTLIKE_OBJECT_TYPE)) {
 8+            url = xs_dict_get(msg, "url");
 9+            if (xs_is_list(url))
10+                url = xs_list_get(url, 0);
11 
12+            if (!xs_is_string(url))
13+                url = xs_dict_get(msg, "id");
14+        }
15 
16         date  = xs_dict_get(msg, "published");
17         udate = xs_dict_get(msg, "updated");