From 3fb0a0acf0921f147e70dbc88e59ebe59d6a9703 Mon Sep 17 00:00:00 2001 From: Louis Brauer Date: Fri, 7 Jun 2024 00:57:33 +0200 Subject: mastoapi: fix create list response & duplicate actor adding --- mastoapi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index a129ad0..bc86f6d 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -1974,7 +1974,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, d = xs_dict_append(d, "replies_policy", "list"); d = xs_dict_append(d, "exclusive", xs_stock(XSTYPE_FALSE)); - out = xs_list_append(out, d); + out = xs_dup(d); break; } } @@ -2971,8 +2971,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, list_content(&snac, id, v, 1); } - *ctype = "application/json"; - status = HTTP_STATUS_OK; + xs *out = xs_dict_new(); + *body = xs_json_dumps(out, 4); + *ctype = "application/json"; + status = HTTP_STATUS_OK; } } } -- cgit v1.2.3