diff options
| author | 2024-03-01 15:34:50 +0100 | |
|---|---|---|
| committer | 2024-03-01 15:34:50 +0100 | |
| commit | 5cb4d249a98cc7df6166733b4022094790a58335 (patch) | |
| tree | f491ab21b235458626cef37100dbfc952d7f67f7 | |
| parent | mastoapi: Fixed bug in account searching. (diff) | |
| download | snac2-5cb4d249a98cc7df6166733b4022094790a58335.tar.gz snac2-5cb4d249a98cc7df6166733b4022094790a58335.tar.xz snac2-5cb4d249a98cc7df6166733b4022094790a58335.zip | |
mastoapi: Correctly show 'Video' objects in /timelines/home.
| -rw-r--r-- | mastoapi.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1462,7 +1462,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1462 | /* discard non-Notes */ | 1462 | /* discard non-Notes */ |
| 1463 | const char *id = xs_dict_get(msg, "id"); | 1463 | const char *id = xs_dict_get(msg, "id"); |
| 1464 | const char *type = xs_dict_get(msg, "type"); | 1464 | const char *type = xs_dict_get(msg, "type"); |
| 1465 | if (!xs_match(type, "Note|Question|Page|Article")) | 1465 | if (!xs_match(type, "Note|Question|Page|Article|Video")) |
| 1466 | continue; | 1466 | continue; |
| 1467 | 1467 | ||
| 1468 | const char *from = NULL; | 1468 | const char *from = NULL; |
| @@ -1492,8 +1492,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1492 | if (is_hidden(&snac1, id)) | 1492 | if (is_hidden(&snac1, id)) |
| 1493 | continue; | 1493 | continue; |
| 1494 | 1494 | ||
| 1495 | /* discard poll votes (they have a name) */ | 1495 | /* if it has a name and it's not a Page or a Video, |
| 1496 | if (strcmp(type, "Page") != 0 && !xs_is_null(xs_dict_get(msg, "name"))) | 1496 | it's a poll vote, so discard it */ |
| 1497 | if (!xs_is_null(xs_dict_get(msg, "name")) && !xs_match(type, "Page|Video")) | ||
| 1497 | continue; | 1498 | continue; |
| 1498 | 1499 | ||
| 1499 | /* convert the Note into a Mastodon status */ | 1500 | /* convert the Note into a Mastodon status */ |