diff options
| author | 2023-05-08 10:13:43 +0200 | |
|---|---|---|
| committer | 2023-05-08 10:13:43 +0200 | |
| commit | de12b8d0a2a4cf374f1c9e4e5b68c781a9ad8f88 (patch) | |
| tree | 199feb28fa92e3209135eb5ecc7c3c84186564a5 | |
| parent | Print the total running time at httpd stop. (diff) | |
| download | penes-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.c | 15 | ||||
| -rw-r--r-- | utils.c | 4 |
2 files changed, 18 insertions, 1 deletions
| @@ -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; |
| @@ -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 | ||
| 31 | const char *default_css = | 33 | const char *default_css = |