diff options
| author | 2023-09-21 21:35:34 +0200 | |
|---|---|---|
| committer | 2023-09-21 21:35:34 +0200 | |
| commit | 5278e89142d4b65816f9b412faf2894923f29775 (patch) | |
| tree | cf47bbc4e04f6059fecd62e31c6e8523a75d74e9 /html.c | |
| parent | Used xs_match() in some places. (diff) | |
| download | snac2-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.c | 7 |
1 files changed, 2 insertions, 5 deletions
| @@ -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 | ||