summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar default2023-05-08 10:13:43 +0200
committerGravatar default2023-05-08 10:13:43 +0200
commitde12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88 (patch)
tree199feb28fa92e3209135eb5ecc7c3c84186564a5 /mastoapi.c
parentPrint the total running time at httpd stop. (diff)
downloadsnac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.tar.gz
snac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.tar.xz
snac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.zip
Fill the mastoapi instance contact_account field, if possible.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 1b9ab09..fe46b23 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1335,6 +1335,21 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1335 1335
1336 ins = xs_dict_append(ins, "configuration", cfg); 1336 ins = xs_dict_append(ins, "configuration", cfg);
1337 1337
1338 const char *admin_account = xs_dict_get(srv_config, "admin_account");
1339
1340 if (!xs_is_null(admin_account) && *admin_account) {
1341 snac admin;
1342
1343 if (user_open(&admin, admin_account)) {
1344 xs *actor = msg_actor(&admin);
1345 xs *acct = mastoapi_account(actor);
1346
1347 ins = xs_dict_append(ins, "contact_account", acct);
1348
1349 user_free(&admin);
1350 }
1351 }
1352
1338 *body = xs_json_dumps_pp(ins, 4); 1353 *body = xs_json_dumps_pp(ins, 4);
1339 *ctype = "application/json"; 1354 *ctype = "application/json";
1340 status = 200; 1355 status = 200;