|
|
|
@ -115,7 +115,7 @@ static bool http_request_route_id( struct http_request* req, int* id )
|
|
|
|
|
|
|
|
|
|
bool route_mastodon_api( struct http_request* req )
|
|
|
|
|
{
|
|
|
|
|
if( http_request_route( req, "apps" ) ) {
|
|
|
|
|
if( http_request_route_term( req, "apps" ) ) {
|
|
|
|
|
if( http_request_route_method( req, "POST" ) ) {
|
|
|
|
|
return handle_mastodon_api_apps(req);
|
|
|
|
|
}
|
|
|
|
@ -167,13 +167,21 @@ bool route_mastodon_api( struct http_request* req )
|
|
|
|
|
} else if( http_request_route( req, "public" ) ) {
|
|
|
|
|
return handle_timeline( req, tli_public );
|
|
|
|
|
}
|
|
|
|
|
} else if( http_request_route( req, "accounts/" ) ) {
|
|
|
|
|
} else if( http_request_route( req, "apps/" ) ) {
|
|
|
|
|
|
|
|
|
|
if( http_request_route( req, "verify_credentials" ) ) {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|
#include "src/view/api/verify_credentials.json.inc"
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if( http_request_route( req, "accounts/" ) ) {
|
|
|
|
|
if( http_request_route( req, "verify_credentials" ) ) {
|
|
|
|
|
struct account* owner = account_from_id(0);
|
|
|
|
|
bool res = handle_mastodon_api_show_account( req, owner );
|
|
|
|
|
account_free(owner);
|
|
|
|
|
return res;
|
|
|
|
|
} else if( http_request_route( req, "relationships" ) ) {
|
|
|
|
|
http_request_send_headers( req, 200, "application/json", true );
|
|
|
|
|
FILE* f = http_request_get_response_body( req );
|
|
|
|
|