summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-12 20:33:42 +0200
committerdefault <nobody@localhost>2023-04-12 20:33:42 +0200
commitec48b8ef8c491da5d0c127730cff6402a12982fa (patch)
tree86b4e7fb12f797ab37b184320ee2bf0e894e3ff5 /mastoapi.c
parentbb61b04e66da46b5786e446c6c452a1defa71522 (diff)
Relationships can only be queried if logged in.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mastoapi.c b/mastoapi.c
index ac2bb30..b579a76 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -679,10 +679,13 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
else
if (strcmp(cmd, "/accounts/relationships") == 0) {
/* find if an account is followed, blocked, etc. */
+ /* the account to get relationships about is in args "id[]" */
/* dummy by now */
- *body = xs_dup("[]");
- *ctype = "application/json";
- status = 200;
+ if (logged_in) {
+ *body = xs_dup("[]");
+ *ctype = "application/json";
+ status = 200;
+ }
}
else
if (xs_startswith(cmd, "/accounts/")) {