commit 5278e89
default
·
2023-09-21 19:35:34 +0000 UTC
parent 749dbef
Added more calls to xs_match().
1 files changed,
+2,
-5
M
html.c
M
html.c
+2,
-5
1@@ -1035,8 +1035,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
2 return xs_str_cat(os, s);
3 }
4 else
5- if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0 &&
6- strcmp(type, "Page") != 0 && strcmp(type, "Article") != 0) {
7+ if (!xs_match(type, "Note|Question|Page|Article")) {
8 /* skip oddities */
9 return os;
10 }
11@@ -1390,9 +1389,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
12 if (xs_list_len(attach) < 2 && xs_match(t, "Link|Document")) {
13 const char *mt = xs_mime_by_ext(url);
14
15- if (xs_startswith(mt, "image/") ||
16- xs_startswith(mt, "audio/") ||
17- xs_startswith(mt, "video/"))
18+ if (xs_match(mt, "image/*|audio/*|video/*")) /* */
19 t = mt;
20 }
21