summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-04-12 20:33:42 +0200
committerGravatar default2023-04-12 20:33:42 +0200
commitec48b8ef8c491da5d0c127730cff6402a12982fa (patch)
tree86b4e7fb12f797ab37b184320ee2bf0e894e3ff5
parentDummy /accounts/relationships. (diff)
downloadpenes-snac2-ec48b8ef8c491da5d0c127730cff6402a12982fa.tar.gz
penes-snac2-ec48b8ef8c491da5d0c127730cff6402a12982fa.tar.xz
penes-snac2-ec48b8ef8c491da5d0c127730cff6402a12982fa.zip
Relationships can only be queried if logged in.
-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,
679 else 679 else
680 if (strcmp(cmd, "/accounts/relationships") == 0) { 680 if (strcmp(cmd, "/accounts/relationships") == 0) {
681 /* find if an account is followed, blocked, etc. */ 681 /* find if an account is followed, blocked, etc. */
682 /* the account to get relationships about is in args "id[]" */
682 /* dummy by now */ 683 /* dummy by now */
683 *body = xs_dup("[]"); 684 if (logged_in) {
684 *ctype = "application/json"; 685 *body = xs_dup("[]");
685 status = 200; 686 *ctype = "application/json";
687 status = 200;
688 }
686 } 689 }
687 else 690 else
688 if (xs_startswith(cmd, "/accounts/")) { 691 if (xs_startswith(cmd, "/accounts/")) {