commit 2057327

default  ·  2025-03-22 07:32:59 +0000 UTC
parent d68d2f5
mastoapi: Added support for /api/v1/instance/peers.
1 files changed,  +9, -0
+9, -0
 1@@ -2256,6 +2256,15 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
 2         status = HTTP_STATUS_OK;
 3     }
 4     else
 5+    if (strcmp(cmd, "/v1/instance/peers") == 0) { /** **/
 6+        /* get the collected inbox list as the instances "this domain is aware of" */
 7+        xs *list = inbox_list();
 8+
 9+        *body  = xs_json_dumps(list, 4);
10+        *ctype = "application/json";
11+        status = HTTP_STATUS_OK;
12+    }
13+    else
14     if (xs_startswith(cmd, "/v1/statuses/")) { /** **/
15         /* information about a status */
16         if (logged_in) {