mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Fixed video attachments.
This commit is contained in:
parent
9bb08cfd51
commit
dd4ba7969f
1 changed files with 15 additions and 13 deletions
|
@ -570,12 +570,13 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
|
|||
while (xs_list_iter(&att, &aobj)) {
|
||||
const char *mtype = xs_dict_get(aobj, "mediaType");
|
||||
|
||||
if (!xs_is_null(mtype) && xs_startswith(mtype, "image/")) {
|
||||
if (!xs_is_null(mtype)) {
|
||||
if (xs_startswith(mtype, "image/") || xs_startswith(mtype, "video/")) {
|
||||
xs *matteid = xs_fmt("%s_%d", id, xs_list_len(matt));
|
||||
xs *matte = xs_dict_new();
|
||||
|
||||
matte = xs_dict_append(matte, "id", matteid);
|
||||
matte = xs_dict_append(matte, "type", "image");
|
||||
matte = xs_dict_append(matte, "type", *mtype == 'i' ? "image" : "video");
|
||||
matte = xs_dict_append(matte, "url", xs_dict_get(aobj, "url"));
|
||||
matte = xs_dict_append(matte, "preview_url", xs_dict_get(aobj, "url"));
|
||||
matte = xs_dict_append(matte, "remote_url", xs_dict_get(aobj, "url"));
|
||||
|
@ -589,6 +590,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
|
|||
matt = xs_list_append(matt, matte);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
st = xs_dict_append(st, "media_attachments", matt);
|
||||
|
||||
|
|
Loading…
Reference in a new issue