diff --git a/include/mastodont_status.h b/include/mastodont_status.h index 64276fe..4765411 100644 --- a/include/mastodont_status.h +++ b/include/mastodont_status.h @@ -128,4 +128,8 @@ int mastodont_create_status(mastodont_t* data, struct mstdnt_create_status_args* args, struct mstdnt_storage* storage); +int mastodont_favourite_status(mastodont_t* data, + char* id, + struct mstdnt_storage* storage); + #endif /* MASTODONT_STATUS */ diff --git a/src/status.c b/src/status.c index a2bc69e..82f6044 100644 --- a/src/status.c +++ b/src/status.c @@ -191,3 +191,22 @@ int mastodont_create_status(mastodont_t* data, return 0; } +int mastodont_favourite_status(mastodont_t* data, + char* id, + struct mstdnt_storage* storage) +{ + char url[MSTDNT_URLSIZE]; + struct mstdnt_fetch_results results = { 0 }; + snprintf(url, MSTDNT_URLSIZE, + "api/v1/%s/favourite", id); + + storage->needs_cleanup = 0; + + if (mastodont_fetch_curl(data, url, &results) != CURLE_OK) + return 1; + + /* TODO Handle errors */ + + mastodont_fetch_results_cleanup(&results); + return 0; +}