diff options
| author | 2025-10-21 12:29:56 +0200 | |
|---|---|---|
| committer | 2025-10-21 12:29:56 +0200 | |
| commit | bebb2c7439ecdef0266f47dc4b05ab093259e63b (patch) | |
| tree | 9b7c90f92bf89a3474eaacb3bcc0e5ec1fbd4b65 /mastoapi.c | |
| parent | Enhances Mastodon API compatibility by adding support for displaying remote u... (diff) | |
| download | snac2-bebb2c7439ecdef0266f47dc4b05ab093259e63b.tar.gz snac2-bebb2c7439ecdef0266f47dc4b05ab093259e63b.tar.xz snac2-bebb2c7439ecdef0266f47dc4b05ab093259e63b.zip | |
Instead of comparing the output status with == 200, it's better to check using valid_status()
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -569,7 +569,7 @@ static const xs_list *get_collection_items(snac *snac, const char *collection_ur | |||
| 569 | const xs_list *items = NULL; | 569 | const xs_list *items = NULL; |
| 570 | xs_dict *collection = NULL; | 570 | xs_dict *collection = NULL; |
| 571 | 571 | ||
| 572 | if (activitypub_request(snac, collection_url, &collection) == 200) { | 572 | if (valid_status(activitypub_request(snac, collection_url, &collection))) { |
| 573 | /* check if items are directly embedded */ | 573 | /* check if items are directly embedded */ |
| 574 | items = xs_dict_get(collection, "orderedItems"); | 574 | items = xs_dict_get(collection, "orderedItems"); |
| 575 | if (xs_is_null(items)) | 575 | if (xs_is_null(items)) |
| @@ -586,7 +586,7 @@ static const xs_list *get_collection_items(snac *snac, const char *collection_ur | |||
| 586 | const char *first_url = xs_dict_get(collection, "first"); | 586 | const char *first_url = xs_dict_get(collection, "first"); |
| 587 | if (!xs_is_null(first_url)) { | 587 | if (!xs_is_null(first_url)) { |
| 588 | xs_dict *first_page = NULL; | 588 | xs_dict *first_page = NULL; |
| 589 | if (activitypub_request(snac, first_url, &first_page) == 200) { | 589 | if (valid_status(activitypub_request(snac, first_url, &first_page))) { |
| 590 | items = xs_dict_get(first_page, "orderedItems"); | 590 | items = xs_dict_get(first_page, "orderedItems"); |
| 591 | if (xs_is_null(items)) | 591 | if (xs_is_null(items)) |
| 592 | items = xs_dict_get(first_page, "items"); | 592 | items = xs_dict_get(first_page, "items"); |