From 4451f88ad523866cb340f8acf7cedb76ccc09d40 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Thu, 21 Apr 2022 02:56:52 +0000 Subject: [PATCH] Copy functions lol FossilOrigin-Name: 97b2b740eab465e8d0f84dc6b8473728849ab08a2a7948fbffab53fbd1afb5a9 --- include/mastodont_status.h | 14 +++++++++++++- src/status.c | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/include/mastodont_status.h b/include/mastodont_status.h index 5d0801b..cb5dc5d 100644 --- a/include/mastodont_status.h +++ b/include/mastodont_status.h @@ -126,7 +126,19 @@ int mastodont_get_status_context(mastodont_t* data, struct mstdnt_status* statuses_after[], size_t* size_before, size_t* size_after); - + +int mastodont_status_favourited_by(mastodont_t* data, + char* id, + struct mstdnt_storage* storage, + struct mstdnt_account* accounts[], + size_t* accts); + +int mastodont_status_reblogged_by(mastodont_t* data, + char* id, + struct mstdnt_storage* storage, + struct mstdnt_account* accounts[], + size_t* accts); + int mastodont_create_status(mastodont_t* data, struct mstdnt_args* args, struct mstdnt_storage* storage); diff --git a/src/status.c b/src/status.c index aed6927..0eb6063 100644 --- a/src/status.c +++ b/src/status.c @@ -433,6 +433,32 @@ int mastodont_get_status_context(mastodont_t* data, return mastodont_request(data, &req_args); } +int mastodont_status_favourited_by(mastodont_t* data, + char* id, + struct mstdnt_storage* storage, + struct mstdnt_account* accounts[], + size_t* accts) +{ + struct mstdnt_account_args args = { + statuses_before, + size_after, + }; + char url[MSTDNT_URLSIZE]; + snprintf(url, MSTDNT_URLSIZE, "api/v1/statuses/%s/context", id); + + struct mastodont_request_args req_args = { + storage, + url, + NULL, 0, + NULL, 0, + CURLOPT_HTTPGET, + &args, + _mstdnt_status_context_from_result_callback, + }; + + return mastodont_request(data, &req_args); +} + void mstdnt_cleanup_status(struct mstdnt_status* status) { cleanup_attachments(status->media_attachments);