|
|
|
@ -145,6 +145,24 @@ bool http_request_write_multipart_to_FILE( struct http_request* req, FILE* f, ch
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// route: GET /api/v1/announcements
|
|
|
|
|
bool handle_announcements( struct http_request* req )
|
|
|
|
|
{
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
fprintf( f, "[]" );
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// route: GET /api/v1/blocks
|
|
|
|
|
bool handle_blocks( struct http_request* req )
|
|
|
|
|
{
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
fprintf( f, "[]" );
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// route: POST /api/v1/media
|
|
|
|
|
bool handle_media( struct http_request* req )
|
|
|
|
|
{
|
|
|
|
@ -256,6 +274,10 @@ bool route_mastodon_api( struct http_request* req )
|
|
|
|
|
|
|
|
|
|
if( http_request_route( req, "notifications" ) ) {
|
|
|
|
|
return handle_notifications(req);
|
|
|
|
|
} else if( http_request_route( req, "announcements" ) ) {
|
|
|
|
|
return handle_announcements(req);
|
|
|
|
|
} else if( http_request_route( req, "blocks" ) ) {
|
|
|
|
|
return handle_blocks(req);
|
|
|
|
|
} else if( http_request_route( req, "filters" ) ) {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|