remove ap_attachment, use object id as ref when an object is provided in an announce

master
teknomunk 1 year ago
parent 1c55d2ce53
commit 091b4d8b2e

@ -1 +1 @@
Subproject commit 8389b565586709300a1b46659c64903e2adb9ed6
Subproject commit c5b137b3370d84e5e4d35f3bcfac26019466dee3

@ -30,8 +30,12 @@ bool route_announce( struct ap_object* act )
}
if( act->object.tag != apaot_ref ) {
printf( "! object not reference\n" );
goto failed;
// Extract the ID and discard the object
char* id = act->object.ptr->id;
act->object.ptr->id = NULL;
ap_object_free( act->object.ptr );
act->object.tag = apaot_ref;
act->object.ref = id;
}
original_post = status_fetch_from_uri( act->object.ref );

@ -5,7 +5,7 @@
#include "collections/array.h"
#include "http/client/client.h"
#include "ap/object.h"
#include "ap/object/rsa_signature_2017.h"
#include "rsa-signature-2017/rsa_signature_2017.h"
// Model
#include "model/server.h"

@ -3,7 +3,7 @@
#include "ffdb/fs_list.h"
#include "ffdb/trie.h"
#include "ap/object.h"
#include "ap/object/rsa_signature_2017.h"
//#include "ap/object/rsa_signature_2017.h"
#include "collections/array.h"
#include "model/account.h"

@ -1 +1 @@
Subproject commit 7eb2ff95d464fba91d7ba4e496aa37a80cbec1de
Subproject commit b67bad77a0728e8a09180a988ee73e9e72bc0681

@ -1 +1 @@
Subproject commit da46920a690aecee8bf72132c3f29862fbec9644
Subproject commit c8d24b62c73737af8b8cd87614651f36475a7352

@ -7,7 +7,6 @@
struct crypto_keys;
struct status;
struct ap_object;
struct ap_account;
struct outbox_envelope;
struct outbox_envelope_list;

@ -67,7 +67,7 @@ struct ap_object* account_ap_actor( struct account* a )
act->public_key = key;
for( int i = 0; i < a->fields.count; ++i ) {
struct ap_attachment* at;
struct ap_object* at;
at = malloc(sizeof(*at));
memset(at,0,sizeof(*at));

@ -252,7 +252,7 @@ struct ap_object* activity_create_Note( struct status* s )
for( int i = 0; i < s->media.count; ++i ) {
struct media* m = media_from_local_uri( s->media.items[i] );
if( m ) {
struct ap_attachment* att;
struct ap_object* att;
att = malloc(sizeof(*att));
memset(att,0,sizeof(*att));

@ -284,7 +284,7 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_object* act )
// Recreate the media field
for( int i = 0; i < act->attachments.count; ++i ) {
struct ap_attachment* att = act->attachments.items[i];
struct ap_object* att = act->attachments.items[i];
if( att && att->url ) {
char* media = strdup( att->url );
array_append( &s->media, sizeof(char*), &media );

Loading…
Cancel
Save