Update to new ap_object::url field type, remove mrf_* from instance info, add faster startup, update activitystreams submodule

master
teknomunk 10 months ago
parent 5b04add122
commit a002edce81

@ -1 +1 @@
Subproject commit 67471e0105e63d7fb407c89af0f0dbecf12695c2 Subproject commit e91d01207ed07972864b43d24a2137edc583dc9d

@ -37,7 +37,14 @@ int main( int argc, char* argv[], char* envp[] )
if( g_server->section == -1 ) { if( g_server->section == -1 ) {
printf( "Starting Apogee ActivityPub server...\n" ); printf( "Starting Apogee ActivityPub server...\n" );
process_start_section(6); process_start_section(6);
sleep(3);
// Make sure we have a hidden service hostname
FILE* f = fopen( "data/tor/hidden_service/hostname", "r" );
if( !f ) {
sleep(3);
} else {
fclose(f);
}
process_start_section(0); process_start_section(0);
process_start_section(1); process_start_section(1);
process_start_section(2); process_start_section(2);

@ -46,16 +46,15 @@ struct ap_object* account_ap_actor( struct account* a )
struct ap_object* avatar = ap_object_new(); struct ap_object* avatar = ap_object_new();
avatar->type = ap_Image; avatar->type = ap_Image;
avatar->url = aformat( "https://%s/owner/avatar.blob", g_server->domain ); ap_object_array_append_ref( &act->url, aformat( "https://%s/owner/avatar.blob", g_server->domain ) );
act->icon = avatar; act->icon = avatar;
struct ap_object* banner = ap_object_new(); struct ap_object* banner = ap_object_new();
banner->type = ap_Image; banner->type = ap_Image;
banner->url = aformat( "https://%s/owner/banner.blob", g_server->domain ); ap_object_array_append_ref( &act->url, aformat( "https://%s/owner/banner.blob", g_server->domain ) );
act->image = banner; act->image = banner;
act->url = aformat( "https://%s/@%s@%s", g_server->domain, a->handle, g_server->domain ); ap_object_array_append_ref( &act->url, aformat( "https://%s/@%s@%s", g_server->domain, a->handle, g_server->domain ) );
act->capabilities.show = true; act->capabilities.show = true;
struct ap_public_key* key; struct ap_public_key* key;

@ -81,8 +81,8 @@ failed:
bool account_sync_from_activity( struct account* a, struct ap_object* obj ) bool account_sync_from_activity( struct account* a, struct ap_object* obj )
{ {
if( obj->url ) { if( obj->url.count > 0 ) {
a->account_url = strdup(obj->url); a->account_url = strdup(obj->url.items[0].ref); // TODO: make this more robust
} else if( obj->id ) { } else if( obj->id ) {
a->account_url = strdup(obj->id); a->account_url = strdup(obj->id);
} else { } else {
@ -106,12 +106,12 @@ bool account_sync_from_activity( struct account* a, struct ap_object* obj )
} else { } else {
a->display_name = strdup(obj->preferred_username); a->display_name = strdup(obj->preferred_username);
} }
if( obj->icon && obj->icon->url ) { if( obj->icon && obj->icon->url.count > 0 ) {
a->avatar.url = strdup(obj->icon->url); a->avatar.url = strdup(obj->icon->url.items[0].ref); // TODO: make this more robust
a->avatar.static_url = strdup(a->avatar.url); a->avatar.static_url = strdup(a->avatar.url);
} }
if( obj->image && obj->image->url ) { if( obj->image && obj->image->url.count > 0 ) {
a->banner = strdup(obj->image->url); a->banner = strdup(obj->image->url.items[0].ref); // TODO: make this more robust
} }
a->bot = ( obj->type != ap_Person ); a->bot = ( obj->type != ap_Person );
a->account_type = at_remote_activity_pub; a->account_type = at_remote_activity_pub;

@ -310,7 +310,7 @@ struct ap_object* activity_create_Note( struct status* s )
memset(att,0,sizeof(*att)); memset(att,0,sizeof(*att));
att->type = ap_Document; att->type = ap_Document;
att->url = strdup(m->remote_url); ap_object_array_append_ref( &att->url, strdup(m->remote_url) );
att->media_type = strdup(m->content_type); att->media_type = strdup(m->content_type);
att->name = strdup(""); att->name = strdup("");

@ -437,9 +437,9 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
// Recreate the media field // Recreate the media field
for( int i = 0; i < act->attachments.count; ++i ) { for( int i = 0; i < act->attachments.count; ++i ) {
struct ap_object* att = act->attachments.items[i]; struct ap_object* att = act->attachments.items[i];
if( att && att->url ) { if( att && att->url.count == 1 ) {
struct media* media = media_new(); struct media* media = media_new();
media->remote_url = strdup( att->url ); media->remote_url = strdup( att->url.items[0].ref );
if( att->media_type ) { if( att->media_type ) {
media->content_type = strdup(att->media_type); media->content_type = strdup(att->media_type);
} }

@ -30,6 +30,7 @@
"federation":{ "federation":{
"enabled":true, "enabled":true,
"exclusions":false, "exclusions":false,
%(/*
"mrf_hashtag":{ "mrf_hashtag":{
"federated_timeline_removal":[], "federated_timeline_removal":[],
"reject":[], "reject":[],
@ -47,6 +48,7 @@
"TagPolicy", "TagPolicy",
"HashtagPolicy" "HashtagPolicy"
], ],
*/)
"quarantined_instances":[] "quarantined_instances":[]
}, },
"fields_limits":{ "fields_limits":{

Loading…
Cancel
Save