aboutsummaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorStefano Marinelli <stefano@dragas.it>2025-10-21 12:29:56 +0200
committerStefano Marinelli <stefano@dragas.it>2025-10-21 12:29:56 +0200
commitbebb2c7439ecdef0266f47dc4b05ab093259e63b (patch)
tree9b7c90f92bf89a3474eaacb3bcc0e5ec1fbd4b65 /mastoapi.c
parent2d433afc27afe46c9641cd0b0bd076566cfb67e2 (diff)
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 119a715..94912f1 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -569,7 +569,7 @@ static const xs_list *get_collection_items(snac *snac, const char *collection_ur
const xs_list *items = NULL;
xs_dict *collection = NULL;
- if (activitypub_request(snac, collection_url, &collection) == 200) {
+ if (valid_status(activitypub_request(snac, collection_url, &collection))) {
/* check if items are directly embedded */
items = xs_dict_get(collection, "orderedItems");
if (xs_is_null(items))
@@ -586,7 +586,7 @@ static const xs_list *get_collection_items(snac *snac, const char *collection_ur
const char *first_url = xs_dict_get(collection, "first");
if (!xs_is_null(first_url)) {
xs_dict *first_page = NULL;
- if (activitypub_request(snac, first_url, &first_page) == 200) {
+ if (valid_status(activitypub_request(snac, first_url, &first_page))) {
items = xs_dict_get(first_page, "orderedItems");
if (xs_is_null(items))
items = xs_dict_get(first_page, "items");