diff options
| author | 2023-08-23 18:32:08 +0200 | |
|---|---|---|
| committer | 2023-08-23 18:32:08 +0200 | |
| commit | 4bc619e2fc4f949cea8b281c0a4da369dae5fa01 (patch) | |
| tree | 3fc518e9b1db928427e20135c6e9dd9aaaffff14 /mastoapi.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-4bc619e2fc4f949cea8b281c0a4da369dae5fa01.tar.gz snac2-4bc619e2fc4f949cea8b281c0a4da369dae5fa01.tar.xz snac2-4bc619e2fc4f949cea8b281c0a4da369dae5fa01.zip | |
mastoapi: process tag lists that are not lists correctly.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 17 |
1 files changed, 14 insertions, 3 deletions
| @@ -767,11 +767,22 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 767 | xs *ml = xs_list_new(); | 767 | xs *ml = xs_list_new(); |
| 768 | xs *htl = xs_list_new(); | 768 | xs *htl = xs_list_new(); |
| 769 | xs *eml = xs_list_new(); | 769 | xs *eml = xs_list_new(); |
| 770 | xs_list *p = xs_dict_get(msg, "tag"); | 770 | xs_list *tag = xs_dict_get(msg, "tag"); |
| 771 | xs_dict *v; | ||
| 772 | int n = 0; | 771 | int n = 0; |
| 773 | 772 | ||
| 774 | while (xs_list_iter(&p, &v)) { | 773 | xs *tag_list = NULL; |
| 774 | |||
| 775 | if (xs_type(tag) == XSTYPE_DICT) { | ||
| 776 | tag_list = xs_list_new(); | ||
| 777 | tag_list = xs_list_append(tag_list, tag); | ||
| 778 | } | ||
| 779 | else | ||
| 780 | tag_list = xs_dup(tag); | ||
| 781 | |||
| 782 | tag = tag_list; | ||
| 783 | xs_dict *v; | ||
| 784 | |||
| 785 | while (xs_list_iter(&tag, &v)) { | ||
| 775 | const char *type = xs_dict_get(v, "type"); | 786 | const char *type = xs_dict_get(v, "type"); |
| 776 | 787 | ||
| 777 | if (xs_is_null(type)) | 788 | if (xs_is_null(type)) |