commit ec48b8e

default  ·  2023-04-12 18:33:42 +0000 UTC
parent bb61b04
Relationships can only be queried if logged in.
1 files changed,  +6, -3
+6, -3
 1@@ -679,10 +679,13 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
 2     else
 3     if (strcmp(cmd, "/accounts/relationships") == 0) {
 4         /* find if an account is followed, blocked, etc. */
 5+        /* the account to get relationships about is in args "id[]" */
 6         /* dummy by now */
 7-        *body  = xs_dup("[]");
 8-        *ctype = "application/json";
 9-        status = 200;
10+        if (logged_in) {
11+            *body  = xs_dup("[]");
12+            *ctype = "application/json";
13+            status = 200;
14+        }
15     }
16     else
17     if (xs_startswith(cmd, "/accounts/")) {