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,
if (xs_is_null(url))
continue;
+ /* if it's a plain Link, check if it can be "rewritten" */
+ if (strcmp(t, "Link") == 0) {
+ const char *mt = xs_mime_by_ext(url);
+
+ if (xs_startswith(mt, "image/") ||
+ xs_startswith(mt, "audio/") ||
+ xs_startswith(mt, "video/"))
+ t = mt;
+ }
+
const char *name = xs_dict_get(v, "name");
if (xs_is_null(name))
name = xs_dict_get(msg, "name");