diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 19 |
1 files changed, 17 insertions, 2 deletions
| @@ -1443,6 +1443,14 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1443 | } | 1443 | } |
| 1444 | } | 1444 | } |
| 1445 | } | 1445 | } |
| 1446 | else | ||
| 1447 | if (strcmp(opt, "featured_tags") == 0) { | ||
| 1448 | /* snac doesn't have features tags, yet? */ | ||
| 1449 | /* implement empty response so apps like Tokodon don't show an error */ | ||
| 1450 | *body = xs_dup("[]"); | ||
| 1451 | *ctype = "application/json"; | ||
| 1452 | status = HTTP_STATUS_OK; | ||
| 1453 | } | ||
| 1446 | 1454 | ||
| 1447 | user_free(&snac2); | 1455 | user_free(&snac2); |
| 1448 | } | 1456 | } |
| @@ -1455,9 +1463,16 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1455 | } | 1463 | } |
| 1456 | else | 1464 | else |
| 1457 | if (strcmp(opt, "statuses") == 0) { | 1465 | if (strcmp(opt, "statuses") == 0) { |
| 1458 | /* we don't serve statuses of others; return the empty list */ | 1466 | /* we don't serve statuses of others; return the empty list */ |
| 1459 | out = xs_list_new(); | 1467 | out = xs_list_new(); |
| 1460 | } | 1468 | } |
| 1469 | if (strcmp(opt, "featured_tags") == 0) { | ||
| 1470 | /* snac doesn't have features tags, yet? */ | ||
| 1471 | /* implement empty response so apps like Tokodon don't show an error */ | ||
| 1472 | *body = xs_dup("[]"); | ||
| 1473 | *ctype = "application/json"; | ||
| 1474 | status = HTTP_STATUS_OK; | ||
| 1475 | } | ||
| 1461 | } | 1476 | } |
| 1462 | } | 1477 | } |
| 1463 | 1478 | ||
| @@ -2031,7 +2046,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2031 | "\"max_characters\":100000,\"max_media_attachments\":8}"); | 2046 | "\"max_characters\":100000,\"max_media_attachments\":8}"); |
| 2032 | cfg = xs_dict_append(cfg, "statuses", d11); | 2047 | cfg = xs_dict_append(cfg, "statuses", d11); |
| 2033 | 2048 | ||
| 2034 | xs *d12 = xs_json_loads("{\"max_featured_tags\":10}"); | 2049 | xs *d12 = xs_json_loads("{\"max_featured_tags\":0}"); |
| 2035 | cfg = xs_dict_append(cfg, "accounts", d12); | 2050 | cfg = xs_dict_append(cfg, "accounts", d12); |
| 2036 | 2051 | ||
| 2037 | xs *d13 = xs_json_loads("{\"image_matrix_limit\":33177600," | 2052 | xs *d13 = xs_json_loads("{\"image_matrix_limit\":33177600," |