diff options
author | default <nobody@localhost> | 2023-04-20 18:37:09 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-04-20 18:37:09 +0200 |
commit | 04e61ea47527475430c6817012578c1bd48c0335 (patch) | |
tree | e0372673c4862ef93df50a27736c2c910502f528 | |
parent | 62447ef19eb4d17ec26d74c3841fe2e12e16f560 (diff) |
More complete mastodon api instance object.
But Megalodon keeps crashing.
-rw-r--r-- | mastoapi.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1032,12 +1032,32 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, xs *d1 = xs_dict_new(); ins = xs_dict_append(ins, "urls", d1); - ins = xs_dict_append(ins, "stats", d1); ins = xs_dict_append(ins, "configuration", d1); + xs *z = xs_number_new(0); + d1 = xs_dict_append(d1, "user_count", z); + d1 = xs_dict_append(d1, "status_count", z); + d1 = xs_dict_append(d1, "domain_count", z); + ins = xs_dict_append(ins, "stats", d1); + + xs *f = xs_val_new(XSTYPE_FALSE); + ins = xs_dict_append(ins, "registrations", f); + ins = xs_dict_append(ins, "approval_required", f); + ins = xs_dict_append(ins, "invites_enabled", f); + + { + snac snac; + user_open(&snac, "test1"); + xs *actor = msg_actor(&snac); + xs *acc = mastoapi_account(actor); + ins = xs_dict_append(ins, "contact_account", acc); + user_free(&snac); + } *body = xs_json_dumps_pp(ins, 4); *ctype = "application/json"; status = 200; + + printf("%s\n", *body); } else if (xs_startswith(cmd, "/v1/statuses/")) { |