snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 5278e89142d4b65816f9b412faf2894923f29775
parent 749dbef349c53ff9bf13f705e674c72ac76e20ca
Author: default <nobody@localhost>
Date:   Thu, 21 Sep 2023 21:35:34 +0200

Added more calls to xs_match().

Diffstat:
Mhtml.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 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, return xs_str_cat(os, s); } else - if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0 && - strcmp(type, "Page") != 0 && strcmp(type, "Article") != 0) { + if (!xs_match(type, "Note|Question|Page|Article")) { /* skip oddities */ return os; } @@ -1390,9 +1389,7 @@ xs_str *html_entry(snac *user, xs_str *os, const xs_dict *msg, int local, if (xs_list_len(attach) < 2 && xs_match(t, "Link|Document")) { const char *mt = xs_mime_by_ext(url); - if (xs_startswith(mt, "image/") || - xs_startswith(mt, "audio/") || - xs_startswith(mt, "video/")) + if (xs_match(mt, "image/*|audio/*|video/*")) /* */ t = mt; }