@ -31,7 +31,6 @@ static bool handle_paged_collection( struct http_request* req, struct pager* pg
ap_object_write_to_FILE ( obj , f ) ;
ap_object_write_to_FILE ( obj , f ) ;
ap_object_free ( obj ) ;
ap_object_free ( obj ) ;
} else if ( http_request_route ( req , " /page- " ) ) {
} else if ( http_request_route ( req , " /page- " ) ) {
printf ( " /page- \n " ) ;
char * page_str = http_request_route_get_dir_or_file ( req ) ;
char * page_str = http_request_route_get_dir_or_file ( req ) ;
int page = - 1 ;
int page = - 1 ;
if ( ! page_str ) { return false ; }
if ( ! page_str ) { return false ; }
@ -52,8 +51,10 @@ static bool handle_paged_collection( struct http_request* req, struct pager* pg
static bool handle_featured ( struct http_request * req )
static bool handle_featured ( struct http_request * req )
{
{
printf ( " User-Agent: %s \n " , http_request_get_header ( req , " user-agent " ) ) ;
struct account * owner_account = account_from_id ( 0 ) ;
struct account * owner_account = account_from_id ( 0 ) ;
//*
struct pager pg = {
struct pager pg = {
. data = owner_account ,
. data = owner_account ,
. get_root = ( void * ) account_ap_featured ,
. get_root = ( void * ) account_ap_featured ,
@ -61,6 +62,13 @@ static bool handle_featured( struct http_request* req )
} ;
} ;
bool result = handle_paged_collection ( req , & pg ) ;
bool result = handle_paged_collection ( req , & pg ) ;
/*/
http_request_add_header ( req , " Access-Control-Allow-Origin " , " * " ) ;
http_request_send_headers ( req , 200 , " application/activity+json " , true ) ;
FILE * f = http_request_get_response_body ( req ) ;
# include "src/view/owner/featured.json.inc"
bool result = true ;
//*/
account_free ( owner_account ) ;
account_free ( owner_account ) ;
return result ;
return result ;
}
}
@ -95,6 +103,8 @@ static bool handle_following( struct http_request* req )
static bool handle_owner_actor ( struct http_request * req )
static bool handle_owner_actor ( struct http_request * req )
{
{
printf ( " User-Agent: %s \n " , http_request_get_header ( req , " user-agent " ) ) ;
struct account * owner_account = account_from_id ( 0 ) ;
struct account * owner_account = account_from_id ( 0 ) ;
http_request_add_header ( req , " Access-Control-Allow-Origin " , " * " ) ;
http_request_add_header ( req , " Access-Control-Allow-Origin " , " * " ) ;
@ -140,7 +150,7 @@ bool route_owner( struct http_request* req )
return handle_following ( req ) ;
return handle_following ( req ) ;
} else if ( http_request_route ( req , " /followers " ) ) {
} else if ( http_request_route ( req , " /followers " ) ) {
return handle_followers ( req ) ;
return handle_followers ( req ) ;
} else if ( http_request_route _term ( req , " /collections/featured " ) ) {
} else if ( http_request_route ( req , " /collections/featured " ) ) {
return handle_featured ( req ) ;
return handle_featured ( req ) ;
} else if ( http_request_route_term ( req , " /avatar.blob " ) ) {
} else if ( http_request_route_term ( req , " /avatar.blob " ) ) {
return handle_avatar ( req ) ;
return handle_avatar ( req ) ;