From 9b27519f657d32b6e1a072b2dbc1816eb6b319af Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Mon, 21 Feb 2022 16:06:40 +0000 Subject: [PATCH] Fix application creation to POST FossilOrigin-Name: 81075edfe438adb0f21e412a92713fd5a12f236925a49b5e1ac8fa78785c382d --- include/mastodont_status.h | 9 ++++++++- src/application.c | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/mastodont_status.h b/include/mastodont_status.h index 4765411..11e1e2d 100644 --- a/include/mastodont_status.h +++ b/include/mastodont_status.h @@ -123,7 +123,14 @@ int mastodont_account_statuses(mastodont_t* data, struct mstdnt_storage* storage, struct mstdnt_status* statuses[], size_t* size); - +int mastodont_status_content(mastodont_t* data, + char* id, + struct mstdnt_storage* storage, + struct mstdnt_status* statuses_before[], + struct mstdnt_status* statuses_after[], + size_t* size_before, + size_t* size_after); + int mastodont_create_status(mastodont_t* data, struct mstdnt_create_status_args* args, struct mstdnt_storage* storage); diff --git a/src/application.c b/src/application.c index c480f56..5ad4b92 100644 --- a/src/application.c +++ b/src/application.c @@ -115,7 +115,7 @@ int mastodont_register_app(mastodont_t* data, curl_easy_setopt(data->curl, CURLOPT_POSTFIELDS, post); - if (mastodont_fetch_curl(data, "api/v1/apps", &results, CURLOPT_HTTPGET) != CURLE_OK) + if (mastodont_fetch_curl(data, "api/v1/apps", &results, CURLOPT_POST) != CURLE_OK) { res = 1; goto cleanup; @@ -183,7 +183,7 @@ int mastodont_obtain_oauth_token(mastodont_t* data, curl_easy_setopt(data->curl, CURLOPT_POSTFIELDS, post); - if (mastodont_fetch_curl(data, "oauth/token", &results, CURLOPT_HTTPGET) != CURLE_OK) + if (mastodont_fetch_curl(data, "oauth/token", &results, CURLOPT_POST) != CURLE_OK) { res = 1; goto cleanup;