|
|
|
@ -106,6 +106,7 @@ bool handle_post( struct http_request* req, struct account* a )
|
|
|
|
|
char* status;
|
|
|
|
|
char* visibility;
|
|
|
|
|
char* in_reply_to_id;
|
|
|
|
|
char* quote_id;
|
|
|
|
|
char* spoiler_text;
|
|
|
|
|
} params;
|
|
|
|
|
memset(¶ms,0,sizeof(params));
|
|
|
|
@ -117,6 +118,7 @@ bool handle_post( struct http_request* req, struct account* a )
|
|
|
|
|
JSON_FIELD_STRING( status, true ),
|
|
|
|
|
JSON_FIELD_STRING( visibility, true ),
|
|
|
|
|
JSON_FIELD_STRING( in_reply_to_id, false ),
|
|
|
|
|
JSON_FIELD_STRING( quote_id, false ),
|
|
|
|
|
JSON_FIELD_STRING( spoiler_text, false ),
|
|
|
|
|
JSON_FIELD_END,
|
|
|
|
|
};
|
|
|
|
@ -140,7 +142,16 @@ bool handle_post( struct http_request* req, struct account* a )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( params.in_reply_to_id ) {
|
|
|
|
|
status_make_reply_to( s, atoi( params.in_reply_to_id ) );
|
|
|
|
|
const char* id = params.in_reply_to_id;
|
|
|
|
|
while( *id == '0' && id[1] != '\0' ) { ++id; }
|
|
|
|
|
|
|
|
|
|
status_make_reply_to( s, atoi( id ) );
|
|
|
|
|
}
|
|
|
|
|
if( params.quote_id ) {
|
|
|
|
|
const char* id = params.quote_id;
|
|
|
|
|
while( *id == '0' && id[1] != '\0' ) { ++id; }
|
|
|
|
|
|
|
|
|
|
status_make_quote_of( s, atoi(id) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Save status data
|
|
|
|
|