From e3f685c03b750536734cc09f12181816843c93f0 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Sat, 23 Apr 2022 02:22:53 +0000 Subject: [PATCH] Reblogged by FossilOrigin-Name: 3d87aaf7d3e7a12b4bf67a16266a7e077ef1711a2b0e067abd7802b14ac0b1df --- src/status.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/status.c b/src/status.c index 0eb6063..d67e908 100644 --- a/src/status.c +++ b/src/status.c @@ -437,14 +437,14 @@ int mastodont_status_favourited_by(mastodont_t* data, char* id, struct mstdnt_storage* storage, struct mstdnt_account* accounts[], - size_t* accts) + size_t* accts_len) { struct mstdnt_account_args args = { - statuses_before, - size_after, + accounts, + accts_len, }; char url[MSTDNT_URLSIZE]; - snprintf(url, MSTDNT_URLSIZE, "api/v1/statuses/%s/context", id); + snprintf(url, MSTDNT_URLSIZE, "api/v1/statuses/%s/favourited_by", id); struct mastodont_request_args req_args = { storage, @@ -453,7 +453,33 @@ int mastodont_status_favourited_by(mastodont_t* data, NULL, 0, CURLOPT_HTTPGET, &args, - _mstdnt_status_context_from_result_callback, + mstdnt_accounts_callback, + }; + + return mastodont_request(data, &req_args); +} + +int mastodont_status_reblogged_by(mastodont_t* data, + char* id, + struct mstdnt_storage* storage, + struct mstdnt_account* accounts[], + size_t* accts_len) +{ + struct mstdnt_account_args args = { + accounts, + accts_len, + }; + char url[MSTDNT_URLSIZE]; + snprintf(url, MSTDNT_URLSIZE, "api/v1/statuses/%s/reblogged_by", id); + + struct mastodont_request_args req_args = { + storage, + url, + NULL, 0, + NULL, 0, + CURLOPT_HTTPGET, + &args, + mstdnt_accounts_callback, }; return mastodont_request(data, &req_args);