Silence debug printfs, remove a inbox blocking condition

master
teknomunk 1 year ago
parent a9a8dd13b6
commit 3c2f038ecc

@ -34,13 +34,22 @@ bool route_add( struct ap_object* act )
// Get the status
if( act->object.tag == apaot_ref ) {
s = status_from_uri_or_fetch( act->object.ref );
if( !s ) {
printf( "Unable to get status for %s\n", act->object.ref );
goto failed;
}
} else if( act->object.ptr->type == ap_Note ) {
printf( "TODO: handle embedded status\n" );
goto failed;
} else {
printf( "Unsupported embedded object type\n" );
goto discard;
}
if( !s ) { goto failed; }
s->pinned = true;
status_save(s);
result = true;
goto discard;
cleanup:
status_free(s);
ap_object_free(apa);
@ -49,4 +58,7 @@ cleanup:
failed:
result = false;
goto cleanup;
discard:
result = true;
goto cleanup;
}

@ -93,14 +93,14 @@ static FILE* open_status_data_file( unsigned int id, const char* mode )
f = fopen( get_status_data_filename(id,filename,sizeof(filename)), mode );
if( f ) {
printf( "Opening %s\n", filename );
//printf( "Opening %s\n", filename );
//printf( "Using new location at %s\n", filename );
return f;
}
f = fopen( format(filename,sizeof(filename), "data/statuses/%d.json", id), mode );
if( f ) {
printf( "Opening %s\n", filename );
//printf( "Opening %s\n", filename );
//printf( "Using existing location at %s\n", filename );
return f;
}
@ -121,7 +121,7 @@ struct status* status_from_id( unsigned int id )
s->id = id;
if( !json_read_object_layout_from_FILE( f, status_layout, s ) ) {
printf( "Failed to load status %d\n", id );
//printf( "Failed to load status %d\n", id );
status_free(s);
return NULL;
}
@ -264,7 +264,7 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
act->actor = strdup( act->attributed_to );
}
printf( "Syncing status from activity %s\n", act->id );
//printf( "Syncing status from activity %s\n", act->id );
ap_object_write_to_FILE( act, stdout );
bool result = false;
struct account* a = account_from_uri_or_fetch(act->actor);
@ -283,7 +283,7 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
status_save_new(s);
if( act->in_reply_to ) {
printf( "Status %d is reply to %s\n", s->id, act->in_reply_to );
//printf( "Status %d is reply to %s\n", s->id, act->in_reply_to );
int parent_id = 0;
struct status* parent = status_from_uri_or_fetch( act->in_reply_to );
@ -297,7 +297,7 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
status_make_reply_to( s, parent_id );
s->in_reply_to = parent_id;
}
printf( "Status %d has been marked as a reply to %d (%s)\n", s->id, parent_id, act->in_reply_to );
//printf( "Status %d has been marked as a reply to %d (%s)\n", s->id, parent_id, act->in_reply_to );
}
if( act->quote_url ) {
int parent_id = 0;
@ -569,7 +569,7 @@ void status_assign_local_id( struct status* s )
bool status_save_new( struct status* s )
{
status_assign_local_id( s );
printf( "Assigning status id %d\n", s->id );
//printf( "Assigning status id %d\n", s->id );
status_save( s );
return true;
@ -579,7 +579,7 @@ void status_save( struct status* s )
{
char filename[512];
json_write_object_layout_to_file( get_status_data_filename(s->id,filename,sizeof(filename)), "\t", status_layout, s );
printf( "Written to %s\n", filename );
//printf( "Written to %s\n", filename );
// Index the status
if( s->url ) {
@ -758,11 +758,10 @@ void status_add_react( struct status* s, const char* react, struct account* a )
// generate outbox element
if( a->id == owner_account_id ) {
if( s->account_id == owner_account_id ) {
// De
printf( "TODO: generate outbox activity for adding reaction '%s' to status #%u by account #%u, deliver to followers\n", react, s->id, a->id );
// Do nothing for reacting to our own post
return;
} else {
// Deliver react to post owner
//printf( "TODO: generate outbox activity for adding reaction '%s' to status #%d by account #%d, deliver to account #%d\n", react, s->id, a->id, s->account_id );
activity_react( s, react );
}
}

Loading…
Cancel
Save