4 次代碼提交 d84b3d431f ... b948a87a1d

作者 SHA1 備註 提交日期
  grunfink b948a87a1d Minor tweak to 'usage' cmdline screen text. 10 小時之前
  grunfink 14a962dd30 Updated RELEASE_NOTES. 11 小時之前
  Uilebheist 475525355e mastoapi: implemented the followers entrypoint. 11 小時之前
  Uilebheist 56cc30a55b mastoapi: added missing 'requested_by' in relationships entrypoint. 11 小時之前
共有 3 個文件被更改,包括 16 次插入2 次删除
  1. 1 1
      RELEASE_NOTES.md
  2. 1 1
      main.c
  3. 14 0
      mastoapi.c

+ 1 - 1
RELEASE_NOTES.md

@@ -8,7 +8,7 @@ Fixed an issue in Direct Messages sent from the people page; these posts didn't
 
 Fixed a socket buffering issue under OpenIndiana (contributed by aleteoryx).
 
-Mastodon API: Fixed posts with muted words not being filtered out.
+Mastodon API: Added missing `requested_by` field in the relationships entrypoint (contributed by Uilebheist), implemented the followers entrypoint (contributed by Uilebheist), fixed posts with muted words not being filtered out.
 
 Added information to README.md on how to build and install on Illumos / OpenIndiana Hipster 2026.04 (contributed by aleteoryx).
 

+ 1 - 1
main.c

@@ -78,7 +78,7 @@ int usage(const char *cmd)
         "list_create {basedir} {uid} {name}   Creates a new list\n"
         "list_remove {basedir} {uid} {name}   Removes an existing list\n"
         "list_add {basedir} {uid} {name} {acct} Adds an account (@user@host or actor url) to a list\n"
-        "list_del {basedir} {uid} {name} {actor} Deletes an actor URL from a list\n"
+        "list_del {basedir} {uid} {name} {actor} Deletes an actor url from a list\n"
         "top_ten {basedir} {uid} [{N}]        Prints the most popular posts\n"
         "refresh {basedir} {uid}              Refreshes all actors\n";
 

+ 14 - 0
mastoapi.c

@@ -1400,6 +1400,8 @@ xs_dict *mastoapi_relationship(snac *snac, const char *md5)
         rel = xs_dict_append(rel, "notifying",            xs_stock(XSTYPE_FALSE));
         rel = xs_dict_append(rel, "followed_by",
             follower_check(snac, actor) ? xs_stock(XSTYPE_TRUE) : xs_stock(XSTYPE_FALSE));
+        rel = xs_dict_append(rel, "requested_by",
+            pending_check(snac, actor) ? xs_stock(XSTYPE_TRUE) : xs_stock(XSTYPE_FALSE));
 
         rel = xs_dict_append(rel, "blocking",
             is_muted(snac, actor) ? xs_stock(XSTYPE_TRUE) : xs_stock(XSTYPE_FALSE));
@@ -2116,7 +2118,19 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
                 }
                 else
                 if (strcmp(opt, "followers") == 0) {
+                    xs *wing = follower_list(&snac1);
                     out = xs_list_new();
+                    int c = 0;
+                    const char *v;
+
+                    while (xs_list_next(wing, &v, &c)) {
+                        xs *actor = NULL;
+
+                        if (valid_status(object_get(v, &actor))) {
+                            xs *acct = mastoapi_account(NULL, actor);
+                            out = xs_list_append(out, acct);
+                        }
+                    }
                 }
                 else
                 if (strcmp(opt, "lists") == 0) {