diff options
| -rw-r--r-- | mastoapi.c | 9 |
1 files changed, 9 insertions, 0 deletions
| @@ -992,6 +992,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 992 | xs *res = xs_list_new(); | 992 | xs *res = xs_list_new(); |
| 993 | const char *md5 = xs_dict_get(args, "id[]"); | 993 | const char *md5 = xs_dict_get(args, "id[]"); |
| 994 | 994 | ||
| 995 | if (xs_is_null(md5)) | ||
| 996 | md5 = xs_dict_get(args, "id"); | ||
| 997 | |||
| 995 | if (!xs_is_null(md5)) { | 998 | if (!xs_is_null(md5)) { |
| 996 | if (xs_type(md5) == XSTYPE_LIST) | 999 | if (xs_type(md5) == XSTYPE_LIST) |
| 997 | md5 = xs_list_get(md5, 0); | 1000 | md5 = xs_list_get(md5, 0); |
| @@ -1792,6 +1795,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1792 | if (xs_is_null(media_ids)) | 1795 | if (xs_is_null(media_ids)) |
| 1793 | media_ids = xs_dict_get(args, "media_ids[]"); | 1796 | media_ids = xs_dict_get(args, "media_ids[]"); |
| 1794 | 1797 | ||
| 1798 | if (xs_is_null(media_ids)) | ||
| 1799 | media_ids = xs_dict_get(args, "media_ids"); | ||
| 1800 | |||
| 1795 | if (xs_is_null(visibility)) | 1801 | if (xs_is_null(visibility)) |
| 1796 | visibility = "public"; | 1802 | visibility = "public"; |
| 1797 | 1803 | ||
| @@ -2158,6 +2164,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2158 | if (strcmp(op, "votes") == 0) { | 2164 | if (strcmp(op, "votes") == 0) { |
| 2159 | xs_list *choices = xs_dict_get(args, "choices[]"); | 2165 | xs_list *choices = xs_dict_get(args, "choices[]"); |
| 2160 | 2166 | ||
| 2167 | if (xs_is_null(choices)) | ||
| 2168 | choices = xs_dict_get(args, "choices"); | ||
| 2169 | |||
| 2161 | if (xs_type(choices) == XSTYPE_LIST) { | 2170 | if (xs_type(choices) == XSTYPE_LIST) { |
| 2162 | xs_str *v; | 2171 | xs_str *v; |
| 2163 | 2172 | ||