diff options
author | default <nobody@localhost> | 2023-04-20 17:59:09 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-04-20 17:59:09 +0200 |
commit | 76445d157afa4431f217fb9a9f21ab69fe7f122d (patch) | |
tree | 5b57269e4dd5075443f5525698755ca27c2bcbac /mastoapi.c | |
parent | 11a89ef0f9c8c4e7d1323fc16900755d7d729395 (diff) |
Use server.json "admin_email" in mastoapi instance object.
Diffstat (limited to 'mastoapi.c')
-rw-r--r-- | mastoapi.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1018,7 +1018,11 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, xs *susie = xs_fmt("%s/susie.png", srv_baseurl); ins = xs_dict_append(ins, "thumbnail", susie); - ins = xs_dict_append(ins, "email", "admin@localhost"); + const char *v = xs_dict_get(srv_config, "admin_email"); + if (xs_is_null(v) || *v == '\0') + v = "admin@localhost"; + + ins = xs_dict_append(ins, "email", v); xs *l1 = xs_list_new(); ins = xs_dict_append(ins, "rules", l1); @@ -1034,6 +1038,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, *body = xs_json_dumps_pp(ins, 4); *ctype = "application/json"; status = 200; + + printf("%s\n", *body); } else if (xs_startswith(cmd, "/v1/statuses/")) { |