mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 06:25:04 +00:00
Implement empty response for /accounts/:id/featured_tags
This commit is contained in:
parent
26fbda787d
commit
dfa0911c88
1 changed files with 17 additions and 2 deletions
19
mastoapi.c
19
mastoapi.c
|
@ -1443,6 +1443,14 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(opt, "featured_tags") == 0) {
|
||||||
|
/* snac doesn't have features tags, yet? */
|
||||||
|
/* implement empty response so apps like Tokodon don't show an error */
|
||||||
|
*body = xs_dup("[]");
|
||||||
|
*ctype = "application/json";
|
||||||
|
status = HTTP_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
user_free(&snac2);
|
user_free(&snac2);
|
||||||
}
|
}
|
||||||
|
@ -1455,9 +1463,16 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(opt, "statuses") == 0) {
|
if (strcmp(opt, "statuses") == 0) {
|
||||||
/* we don't serve statuses of others; return the empty list */
|
/* we don't serve statuses of others; return the empty list */
|
||||||
out = xs_list_new();
|
out = xs_list_new();
|
||||||
}
|
}
|
||||||
|
if (strcmp(opt, "featured_tags") == 0) {
|
||||||
|
/* snac doesn't have features tags, yet? */
|
||||||
|
/* implement empty response so apps like Tokodon don't show an error */
|
||||||
|
*body = xs_dup("[]");
|
||||||
|
*ctype = "application/json";
|
||||||
|
status = HTTP_STATUS_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2031,7 +2046,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
"\"max_characters\":100000,\"max_media_attachments\":8}");
|
"\"max_characters\":100000,\"max_media_attachments\":8}");
|
||||||
cfg = xs_dict_append(cfg, "statuses", d11);
|
cfg = xs_dict_append(cfg, "statuses", d11);
|
||||||
|
|
||||||
xs *d12 = xs_json_loads("{\"max_featured_tags\":10}");
|
xs *d12 = xs_json_loads("{\"max_featured_tags\":0}");
|
||||||
cfg = xs_dict_append(cfg, "accounts", d12);
|
cfg = xs_dict_append(cfg, "accounts", d12);
|
||||||
|
|
||||||
xs *d13 = xs_json_loads("{\"image_matrix_limit\":33177600,"
|
xs *d13 = xs_json_loads("{\"image_matrix_limit\":33177600,"
|
||||||
|
|
Loading…
Reference in a new issue