commit 0000450
default
·
2024-12-21 15:49:45 +0000 UTC
parent 1167b64
mastoapi: fixed audio attachments.
1 files changed,
+3,
-2
+3,
-2
1@@ -912,7 +912,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
2 const char *o_href = xs_dict_get(v, "href");
3 const char *name = xs_dict_get(v, "name");
4
5- if (xs_match(type, "image/*|video/*|Image|Video")) { /* */
6+ if (xs_match(type, "image/*|video/*|audio/*|Image|Video")) { /* */
7 xs *matteid = xs_fmt("%s_%d", id, xs_list_len(matt));
8 xs *href = make_url(o_href, proxy, 1);
9
10@@ -924,7 +924,8 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
11 d = xs_dict_append(d, "remote_url", href);
12 d = xs_dict_append(d, "description", name);
13
14- d = xs_dict_append(d, "type", (*type == 'v' || *type == 'V') ? "video" : "image");
15+ d = xs_dict_append(d, "type", (*type == 'v' || *type == 'V') ? "video" :
16+ (*type == 'a' || *type == 'A') ? "audio" : "image");
17
18 matt = xs_list_append(matt, d);
19 }