summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-05-08 10:13:43 +0200
committerGravatar default2023-05-08 10:13:43 +0200
commitde12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88 (patch)
tree199feb28fa92e3209135eb5ecc7c3c84186564a5
parentPrint the total running time at httpd stop. (diff)
downloadpenes-snac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.tar.gz
penes-snac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.tar.xz
penes-snac2-de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88.zip
Fill the mastoapi instance contact_account field, if possible.
-rw-r--r--mastoapi.c15
-rw-r--r--utils.c4
2 files changed, 18 insertions, 1 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;
diff --git a/utils.c b/utils.c
index 14e9f5d..189bd18 100644
--- a/utils.c
+++ b/utils.c
@@ -25,7 +25,9 @@ const char *default_srv_config = "{"
25 "\"cssurls\": [\"\"]," 25 "\"cssurls\": [\"\"],"
26 "\"max_timeline_entries\": 128," 26 "\"max_timeline_entries\": 128,"
27 "\"timeline_purge_days\": 120," 27 "\"timeline_purge_days\": 120,"
28 "\"local_purge_days\": 0" 28 "\"local_purge_days\": 0,"
29 "\"admin_email\": \"\","
30 "\"admin_account\": \"\""
29 "}"; 31 "}";
30 32
31const char *default_css = 33const char *default_css =