mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
mastoapi: process tag lists that are not lists correctly.
This commit is contained in:
parent
3cc2098023
commit
4bc619e2fc
1 changed files with 14 additions and 3 deletions
17
mastoapi.c
17
mastoapi.c
|
@ -767,11 +767,22 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
|
||||||
xs *ml = xs_list_new();
|
xs *ml = xs_list_new();
|
||||||
xs *htl = xs_list_new();
|
xs *htl = xs_list_new();
|
||||||
xs *eml = xs_list_new();
|
xs *eml = xs_list_new();
|
||||||
xs_list *p = xs_dict_get(msg, "tag");
|
xs_list *tag = xs_dict_get(msg, "tag");
|
||||||
xs_dict *v;
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
while (xs_list_iter(&p, &v)) {
|
xs *tag_list = NULL;
|
||||||
|
|
||||||
|
if (xs_type(tag) == XSTYPE_DICT) {
|
||||||
|
tag_list = xs_list_new();
|
||||||
|
tag_list = xs_list_append(tag_list, tag);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tag_list = xs_dup(tag);
|
||||||
|
|
||||||
|
tag = tag_list;
|
||||||
|
xs_dict *v;
|
||||||
|
|
||||||
|
while (xs_list_iter(&tag, &v)) {
|
||||||
const char *type = xs_dict_get(v, "type");
|
const char *type = xs_dict_get(v, "type");
|
||||||
|
|
||||||
if (xs_is_null(type))
|
if (xs_is_null(type))
|
||||||
|
|
Loading…
Reference in a new issue