summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar grunfink2025-06-21 19:08:38 +0200
committerGravatar grunfink2025-06-21 19:08:38 +0200
commitfa986ad91e15bdea6a9764d04fdb90e404d39e55 (patch)
tree424c1b63c01a35648036e00f543f3da2a96fde95
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-fa986ad91e15bdea6a9764d04fdb90e404d39e55.tar.gz
snac2-fa986ad91e15bdea6a9764d04fdb90e404d39e55.tar.xz
snac2-fa986ad91e15bdea6a9764d04fdb90e404d39e55.zip
Added support for /api/v1/instance/extended_description (with a hardcoded text).
-rw-r--r--mastoapi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 2e8063b..0829a84 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -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) {