Fix SEGV, add peers route, fix version 2.1 nodeinfo response, throw away rejects

master
teknomunk 1 year ago
parent 51840b57a8
commit 39fd099716

@ -489,6 +489,12 @@ static bool route_accept( struct ap_object* act )
// In particular, this needs to change a follow request to a following accepted
return true;
}
static bool route_reject( struct ap_object* act )
{
// TODO: actually handle rejects
// In particular, this needs to change a follow request to a rejected notification
return true;
}
bool route_activity( struct ap_object* act )
{
@ -501,6 +507,7 @@ bool route_activity( struct ap_object* act )
case ap_Like: return route_like(act);
case ap_Create: return route_create(act);
case ap_Accept: return route_accept(act);
case ap_Reject: return route_reject(act);
case ap_Announce: return route_announce(act);
case ap_Add: return route_add(act);
case pleroma_EmojiReact: return route_emoji_react(act);

@ -200,10 +200,20 @@ bool route_mastodon_api( struct http_request* req )
} else if( http_request_route( req, "timelines/public" ) ) {
return handle_timeline( req, tli_public );
} else if( http_request_route( req, "instance" ) ) {
http_request_send_headers( req, 200, "application/json", true );
FILE* f = http_request_get_response_body( req );
#include "src/view/api/instance_data.json.inc"
return true;
if( http_request_route_term( req, "/peers" ) ) {
http_request_send_headers( req, 200, "application/json", true );
FILE* f = http_request_get_response_body( req );
fprintf( f, "[" );
fprintf( f, "\"poa.st\"" );
// TODO: print peers
fprintf( f, "]" );
return true;
} else {
http_request_send_headers( req, 200, "application/json", true );
FILE* f = http_request_get_response_body( req );
#include "src/view/api/instance_data.json.inc"
return true;
}
} else if( http_request_route_term( req, "custom_emojis" ) ) {
return route_custom_emojis(req);
} else if( http_request_route( req, "statuses" ) ) {

@ -378,7 +378,9 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
if( att && att->url ) {
struct media* media = media_new();
media->remote_url = strdup( att->url );
media->content_type = strdup(att->media_type);
if( att->media_type ) {
media->content_type = strdup(att->media_type);
}
array_append( &s->media2, sizeof(char*), &media );
}
}

@ -3,7 +3,7 @@
"software": {
"name": "apogee",
"version": "0.1alpha",
"repository": "https://gitea.polaris-1.work/teknomunk/apogee",
"repository": "https://gitea.polaris-1.work/teknomunk/apogee"
},
"protocols": ["activitypub"],
"services": {

Loading…
Cancel
Save