mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-29 07:53:37 +00:00
More mastoapi tweaks.
This commit is contained in:
parent
a0906208ea
commit
2f0d604f0c
1 changed files with 9 additions and 0 deletions
|
@ -992,6 +992,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
xs *res = xs_list_new();
|
xs *res = xs_list_new();
|
||||||
const char *md5 = xs_dict_get(args, "id[]");
|
const char *md5 = xs_dict_get(args, "id[]");
|
||||||
|
|
||||||
|
if (xs_is_null(md5))
|
||||||
|
md5 = xs_dict_get(args, "id");
|
||||||
|
|
||||||
if (!xs_is_null(md5)) {
|
if (!xs_is_null(md5)) {
|
||||||
if (xs_type(md5) == XSTYPE_LIST)
|
if (xs_type(md5) == XSTYPE_LIST)
|
||||||
md5 = xs_list_get(md5, 0);
|
md5 = xs_list_get(md5, 0);
|
||||||
|
@ -1792,6 +1795,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
||||||
if (xs_is_null(media_ids))
|
if (xs_is_null(media_ids))
|
||||||
media_ids = xs_dict_get(args, "media_ids[]");
|
media_ids = xs_dict_get(args, "media_ids[]");
|
||||||
|
|
||||||
|
if (xs_is_null(media_ids))
|
||||||
|
media_ids = xs_dict_get(args, "media_ids");
|
||||||
|
|
||||||
if (xs_is_null(visibility))
|
if (xs_is_null(visibility))
|
||||||
visibility = "public";
|
visibility = "public";
|
||||||
|
|
||||||
|
@ -2158,6 +2164,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
||||||
if (strcmp(op, "votes") == 0) {
|
if (strcmp(op, "votes") == 0) {
|
||||||
xs_list *choices = xs_dict_get(args, "choices[]");
|
xs_list *choices = xs_dict_get(args, "choices[]");
|
||||||
|
|
||||||
|
if (xs_is_null(choices))
|
||||||
|
choices = xs_dict_get(args, "choices");
|
||||||
|
|
||||||
if (xs_type(choices) == XSTYPE_LIST) {
|
if (xs_type(choices) == XSTYPE_LIST) {
|
||||||
xs_str *v;
|
xs_str *v;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue