summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-20 18:37:09 +0200
committerdefault <nobody@localhost>2023-04-20 18:37:09 +0200
commit04e61ea47527475430c6817012578c1bd48c0335 (patch)
treee0372673c4862ef93df50a27736c2c910502f528 /mastoapi.c
parent62447ef19eb4d17ec26d74c3841fe2e12e16f560 (diff)
More complete mastodon api instance object.
But Megalodon keeps crashing.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 9767fcc..68172fa 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -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/")) {