diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 15 |
1 files changed, 15 insertions, 0 deletions
| @@ -2337,6 +2337,21 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2337 | status = HTTP_STATUS_OK; | 2337 | status = HTTP_STATUS_OK; |
| 2338 | } | 2338 | } |
| 2339 | else | 2339 | else |
| 2340 | if (strcmp(cmd, "/v1/instance/extended_description") == 0) { /** **/ | ||
| 2341 | xs *d = xs_dict_new(); | ||
| 2342 | xs *greeting = xs_fmt("%s/greeting.html", srv_basedir); | ||
| 2343 | time_t t = mtime(greeting); | ||
| 2344 | xs *updated_at = xs_str_iso_date(t); | ||
| 2345 | xs *content = xs_replace(snac_blurb, "%host%", xs_dict_get(srv_config, "host")); | ||
| 2346 | |||
| 2347 | d = xs_dict_set(d, "updated_at", updated_at); | ||
| 2348 | d = xs_dict_set(d, "content", content); | ||
| 2349 | |||
| 2350 | *body = xs_json_dumps(d, 4); | ||
| 2351 | *ctype = "application/json"; | ||
| 2352 | status = HTTP_STATUS_OK; | ||
| 2353 | } | ||
| 2354 | else | ||
| 2340 | if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ | 2355 | if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ |
| 2341 | /* information about a status */ | 2356 | /* information about a status */ |
| 2342 | if (logged_in) { | 2357 | if (logged_in) { |