Fix memory leak, passthrough sensitive field of Activity

master
teknomunk 1 year ago
parent b06c9b4c48
commit 34135f9da0

@ -203,10 +203,12 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_activity* act )
printf( "! Unable to get account for %s\n", act->actor );
goto failed;
}
s->account_id = a->id;
s->published = act->published;
s->remote = true;
s->stub = false;
s->sensitive = act->sensitive;
if( act->in_reply_to ) {
struct status* parent = status_from_uri_or_fetch( act->in_reply_to );
@ -253,6 +255,7 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_activity* act )
if( !s->source ) {
printf( "? No source, using content directly\n" );
free(s->content);
s->content = safe_strdup(act->content.content);
}

@ -418,7 +418,7 @@ struct json_object_field api_Status_layout[] = {
.offset = offsetof( OBJ_TYPE, replies.count ),
.type = &json_field_integer,
},
JSON_FIELD_FIXED_BOOL( sensitive, false ),
JSON_FIELD_BOOL( sensitive, false ),
JSON_FIELD_FIXED_STRING( spoiler_text, "", true ),
JSON_FIELD_EMPTY_ARRAY( tags, true ),
JSON_FIELD_FIXED_NULL( text ),

Loading…
Cancel
Save