diff options
| author | 2025-03-22 08:32:59 +0100 | |
|---|---|---|
| committer | 2025-03-22 08:32:59 +0100 | |
| commit | 20573275ec8f7cc7f5744a3280590040a6f14203 (patch) | |
| tree | a878301e703e163b05bc08ba45acca94d96cc8e5 /mastoapi.c | |
| parent | Merge pull request 'added missing czech translations' (#332) from pmjv/snac2:... (diff) | |
| download | snac2-20573275ec8f7cc7f5744a3280590040a6f14203.tar.gz snac2-20573275ec8f7cc7f5744a3280590040a6f14203.tar.xz snac2-20573275ec8f7cc7f5744a3280590040a6f14203.zip | |
mastoapi: Added support for /api/v1/instance/peers.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 9 |
1 files changed, 9 insertions, 0 deletions
| @@ -2256,6 +2256,15 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2256 | status = HTTP_STATUS_OK; | 2256 | status = HTTP_STATUS_OK; |
| 2257 | } | 2257 | } |
| 2258 | else | 2258 | else |
| 2259 | if (strcmp(cmd, "/v1/instance/peers") == 0) { /** **/ | ||
| 2260 | /* get the collected inbox list as the instances "this domain is aware of" */ | ||
| 2261 | xs *list = inbox_list(); | ||
| 2262 | |||
| 2263 | *body = xs_json_dumps(list, 4); | ||
| 2264 | *ctype = "application/json"; | ||
| 2265 | status = HTTP_STATUS_OK; | ||
| 2266 | } | ||
| 2267 | else | ||
| 2259 | if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ | 2268 | if (xs_startswith(cmd, "/v1/statuses/")) { /** **/ |
| 2260 | /* information about a status */ | 2269 | /* information about a status */ |
| 2261 | if (logged_in) { | 2270 | if (logged_in) { |