summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/html.c b/html.c
index 8e45eba..e132f17 100644
--- a/html.c
+++ b/html.c
@@ -1313,6 +1313,16 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
1313 if (xs_is_null(url)) 1313 if (xs_is_null(url))
1314 continue; 1314 continue;
1315 1315
1316 /* if it's a plain Link, check if it can be "rewritten" */
1317 if (strcmp(t, "Link") == 0) {
1318 const char *mt = xs_mime_by_ext(url);
1319
1320 if (xs_startswith(mt, "image/") ||
1321 xs_startswith(mt, "audio/") ||
1322 xs_startswith(mt, "video/"))
1323 t = mt;
1324 }
1325
1316 const char *name = xs_dict_get(v, "name"); 1326 const char *name = xs_dict_get(v, "name");
1317 if (xs_is_null(name)) 1327 if (xs_is_null(name))
1318 name = xs_dict_get(msg, "name"); 1328 name = xs_dict_get(msg, "name");