commit 4755253
Uilebheist
·
2026-09-19 06:06:53 +0000 UTC
parent 56cc30a
mastoapi: implemented the followers entrypoint.
1 files changed,
+12,
-0
+12,
-0
1@@ -2118,7 +2118,19 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
2 }
3 else
4 if (strcmp(opt, "followers") == 0) {
5+ xs *wing = follower_list(&snac1);
6 out = xs_list_new();
7+ int c = 0;
8+ const char *v;
9+
10+ while (xs_list_next(wing, &v, &c)) {
11+ xs *actor = NULL;
12+
13+ if (valid_status(object_get(v, &actor))) {
14+ xs *acct = mastoapi_account(NULL, actor);
15+ out = xs_list_append(out, acct);
16+ }
17+ }
18 }
19 else
20 if (strcmp(opt, "lists") == 0) {