Просмотр исходного кода

Relationships can only be queried if logged in.

default 3 лет назад
Родитель
Сommit
ec48b8ef8c
1 измененных файлов с 6 добавлено и 3 удалено
  1. 6 3
      mastoapi.c

+ 6 - 3
mastoapi.c

@@ -679,10 +679,13 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
     else
     else
     if (strcmp(cmd, "/accounts/relationships") == 0) {
     if (strcmp(cmd, "/accounts/relationships") == 0) {
         /* find if an account is followed, blocked, etc. */
         /* find if an account is followed, blocked, etc. */
+        /* the account to get relationships about is in args "id[]" */
         /* dummy by now */
         /* dummy by now */
-        *body  = xs_dup("[]");
-        *ctype = "application/json";
-        status = 200;
+        if (logged_in) {
+            *body  = xs_dup("[]");
+            *ctype = "application/json";
+            status = 200;
+        }
     }
     }
     else
     else
     if (xs_startswith(cmd, "/accounts/")) {
     if (xs_startswith(cmd, "/accounts/")) {