浏览代码

mastoapi: Added support for /api/v1/instance/peers.

default 1 周之前
父节点
当前提交
20573275ec
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      mastoapi.c

+ 9 - 0
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) {