Fix status submission

FossilOrigin-Name: 5f60ebaa5fd46b5a954c0631e25ebf45f7b9ed9b917900a880f675062afa5140
This commit is contained in:
nekobit 2023-06-01 02:45:48 +00:00
parent 3a9dfa3dc9
commit fa92ac39d4
2 changed files with 26 additions and 23 deletions

View File

@ -88,9 +88,8 @@ request_cb_oauth_token(struct mstdnt_request_cb_data* cb_data,
apply_access_token(req, token->access_token);
path_args_data_destroy(path_data);
return MSTDNT_REQUEST_DATA_NOCLEANUP;
return MSTDNT_REQUEST_DONE;
}
// Callback: mstdnt_register_app

View File

@ -31,7 +31,6 @@
int try_post_status(struct session* ssn, mastodont_t* api)
{
#if 0
if (!(keystr(ssn->post.content))) return 1;
struct mstdnt_args m_args;
set_mstdnt_args(&m_args, ssn);
@ -41,6 +40,7 @@ int try_post_status(struct session* ssn, mastodont_t* api)
// a MIME post request
m_args.flags ^= MSTDNT_FLAG_NO_URI_SANITIZE;
#if 0
char** files = NULL;
size_t files_len = 0;
struct mstdnt_attachment* attachments = NULL;
@ -72,30 +72,34 @@ int try_post_status(struct session* ssn, mastodont_t* api)
}
}
#endif
// Cookie copy and read
struct mstdnt_status_args args = {
.content_type = "text/plain",
.expires_in = 0,
.in_reply_to_conversation_id = NULL,
.in_reply_to_id = keystr(ssn->post.replyid),
.language = NULL,
.media_ids = media_ids,
.media_ids_len = (!ssn->post.file_ids.is_set ? keyfile(ssn->post.files).array_size :
mstdnt_create_status(api, &m_args, NULL, NULL,
(struct mstdnt_status_args)
{
.content_type = "text/plain",
.expires_in = 0,
.in_reply_to_conversation_id = NULL,
.in_reply_to_id = keystr(ssn->post.replyid),
.language = NULL,
/*
.media_ids = media_ids,
.media_ids_len = (!ssn->post.file_ids.is_set ? keyfile(ssn->post.files).array_size :
(json_ids ? json_ids_len : 0)),
.poll = NULL,
.preview = 0,
.scheduled_at = NULL,
.sensitive = 0,
.spoiler_text = NULL,
.status = keystr(ssn->post.content),
.visibility = keystr(ssn->post.visibility),
};
*/
.media_ids = NULL,
.media_ids_len = 0,
.poll = NULL,
.preview = 0,
.scheduled_at = NULL,
.sensitive = 0,
.spoiler_text = NULL,
.status = keystr(ssn->post.content),
.visibility = keystr(ssn->post.visibility),
});
#if 0
// Finally, create (no error checking)
mstdnt_create_status(api, &m_args, NULL, NULL, args);
mstdnt_storage_cleanup(&storage);
if (att_storage)
cleanup_media_storages(ssn, att_storage);