summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2023-09-21 21:35:34 +0200
committerGravatar default2023-09-21 21:35:34 +0200
commit5278e89142d4b65816f9b412faf2894923f29775 (patch)
treecf47bbc4e04f6059fecd62e31c6e8523a75d74e9 /html.c
parentUsed xs_match() in some places. (diff)
downloadsnac2-5278e89142d4b65816f9b412faf2894923f29775.tar.gz
snac2-5278e89142d4b65816f9b412faf2894923f29775.tar.xz
snac2-5278e89142d4b65816f9b412faf2894923f29775.zip
Added more calls to xs_match().
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/html.c b/html.c
index 175dcdc..58319c6 100644
--- a/html.c
+++ b/html.c
@@ -1035,8 +1035,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
1035 return xs_str_cat(os, s); 1035 return xs_str_cat(os, s);
1036 } 1036 }
1037 else 1037 else
1038 if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0 && 1038 if (!xs_match(type, "Note|Question|Page|Article")) {
1039 strcmp(type, "Page") != 0 && strcmp(type, "Article") != 0) {
1040 /* skip oddities */ 1039 /* skip oddities */
1041 return os; 1040 return os;
1042 } 1041 }
@@ -1390,9 +1389,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local,
1390 if (xs_list_len(attach) < 2 && xs_match(t, "Link|Document")) { 1389 if (xs_list_len(attach) < 2 && xs_match(t, "Link|Document")) {
1391 const char *mt = xs_mime_by_ext(url); 1390 const char *mt = xs_mime_by_ext(url);
1392 1391
1393 if (xs_startswith(mt, "image/") || 1392 if (xs_match(mt, "image/*|audio/*|video/*")) /* */
1394 xs_startswith(mt, "audio/") ||
1395 xs_startswith(mt, "video/"))
1396 t = mt; 1393 t = mt;
1397 } 1394 }
1398 1395