diff options
| author | 2023-04-12 20:33:42 +0200 | |
|---|---|---|
| committer | 2023-04-12 20:33:42 +0200 | |
| commit | ec48b8ef8c491da5d0c127730cff6402a12982fa (patch) | |
| tree | 86b4e7fb12f797ab37b184320ee2bf0e894e3ff5 | |
| parent | Dummy /accounts/relationships. (diff) | |
| download | penes-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -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/")) { |