mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
mastoapi: Added fields list in verify_credentials.
This commit is contained in:
parent
f556cb5c7d
commit
e14ad56994
1 changed files with 19 additions and 0 deletions
19
mastoapi.c
19
mastoapi.c
|
@ -1044,6 +1044,25 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
acct = xs_dict_append(acct, "avatar", avatar);
|
acct = xs_dict_append(acct, "avatar", avatar);
|
||||||
acct = xs_dict_append(acct, "avatar_static", avatar);
|
acct = xs_dict_append(acct, "avatar_static", avatar);
|
||||||
|
|
||||||
|
xs_dict *metadata = xs_dict_get(snac1.config, "metadata");
|
||||||
|
if (xs_type(metadata) == XSTYPE_DICT) {
|
||||||
|
xs *fields = xs_list_new();
|
||||||
|
xs_str *k;
|
||||||
|
xs_str *v;
|
||||||
|
|
||||||
|
while (xs_dict_iter(&metadata, &k, &v)) {
|
||||||
|
xs *d = xs_dict_new();
|
||||||
|
|
||||||
|
d = xs_dict_append(d, "name", k);
|
||||||
|
d = xs_dict_append(d, "value", v);
|
||||||
|
d = xs_dict_append(d, "verified_at", xs_stock_null);
|
||||||
|
|
||||||
|
fields = xs_list_append(fields, d);
|
||||||
|
}
|
||||||
|
|
||||||
|
acct = xs_dict_set(acct, "fields", fields);
|
||||||
|
}
|
||||||
|
|
||||||
*body = xs_json_dumps(acct, 4);
|
*body = xs_json_dumps(acct, 4);
|
||||||
*ctype = "application/json";
|
*ctype = "application/json";
|
||||||
status = 200;
|
status = 200;
|
||||||
|
|
Loading…
Reference in a new issue