Added snac limits (no real limits) to the Instance object.

This commit is contained in:
default 2023-04-24 16:29:21 +02:00
parent ec961a6cef
commit 415381831e

View file

@ -1132,7 +1132,6 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
xs *d1 = xs_dict_new(); xs *d1 = xs_dict_new();
ins = xs_dict_append(ins, "urls", d1); ins = xs_dict_append(ins, "urls", d1);
ins = xs_dict_append(ins, "configuration", d1);
xs *z = xs_number_new(0); xs *z = xs_number_new(0);
d1 = xs_dict_append(d1, "user_count", z); d1 = xs_dict_append(d1, "user_count", z);
@ -1145,14 +1144,23 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
ins = xs_dict_append(ins, "approval_required", f); ins = xs_dict_append(ins, "approval_required", f);
ins = xs_dict_append(ins, "invites_enabled", f); ins = xs_dict_append(ins, "invites_enabled", f);
/* { xs *cfg = xs_dict_new();
snac snac;
user_open(&snac, "test1"); {
xs *actor = msg_actor(&snac); xs *d11 = xs_dict_new();
xs *acc = mastoapi_account(actor); xs *mc = xs_number_new(100000);
ins = xs_dict_append(ins, "contact_account", acc); xs *mm = xs_number_new(8);
user_free(&snac); xs *cr = xs_number_new(32);
}*/
d11 = xs_dict_append(d11, "max_characters", mc);
d11 = xs_dict_append(d11, "max_media_attachments", mm);
d11 = xs_dict_append(d11, "characters_reserved_per_url", cr);
cfg = xs_dict_append(cfg, "statuses", d11);
}
ins = xs_dict_append(ins, "configuration", cfg);
*body = xs_json_dumps_pp(ins, 4); *body = xs_json_dumps_pp(ins, 4);
*ctype = "application/json"; *ctype = "application/json";
status = 200; status = 200;