summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-08-13 13:00:36 +0200
committerGravatar default2023-08-13 13:00:36 +0200
commit2f0d604f0c58ed89b4f93a483024f1122927c385 (patch)
tree78a24cfd482d77dafc4fa8d2ac916aa570a27a9d
parentUse some new xs_stock values. (diff)
downloadsnac2-2f0d604f0c58ed89b4f93a483024f1122927c385.tar.gz
snac2-2f0d604f0c58ed89b4f93a483024f1122927c385.tar.xz
snac2-2f0d604f0c58ed89b4f93a483024f1122927c385.zip
More mastoapi tweaks.
-rw-r--r--mastoapi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 99e78ea..6fd0cf1 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -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