From 20573275ec8f7cc7f5744a3280590040a6f14203 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 22 Mar 2025 08:32:59 +0100 Subject: mastoapi: Added support for /api/v1/instance/peers. --- mastoapi.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index 8d61681..14dd251 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -2256,6 +2256,15 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, status = HTTP_STATUS_OK; } else + if (strcmp(cmd, "/v1/instance/peers") == 0) { /** **/ + /* get the collected inbox list as the instances "this domain is aware of" */ + xs *list = inbox_list(); + + *body = xs_json_dumps(list, 4); + *ctype = "application/json"; + status = HTTP_STATUS_OK; + } + else if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ /* information about a status */ if (logged_in) { -- cgit v1.2.3