@ -96,19 +96,19 @@ struct ap_object* activity_create_EmojiReact( struct status* s, struct account*
struct ap_object * act = activity_new_local_activity ( ) ;
activity_allocate_local_id ( act ) ;
act - > id = aformat ( " https://%s/activity/%d " , g_server - > domain , act - > local_id ) ;
act - > actor = strdup ( reactor - > account_ url ) ;
act - > actor = strdup ( reactor - > account_ id ) ;
act - > type = pleroma_EmojiReact ;
act - > content . content = safe_strdup ( react ) ;
act - > published = time ( NULL ) ;
act - > object . tag = apaot_ref ;
act - > object . ref = strdup ( s - > url ) ;
char * to = aformat ( " %s/followers " , a - > account_ url ) ;
char * to = aformat ( " %s/followers " , a - > account_ id ) ;
array_append ( & act - > to , sizeof ( to ) , & to ) ;
char * cc = strdup ( " https://www.w3.org/ns/activitystreams#Public " ) ;
array_append ( & act - > cc , sizeof ( cc ) , & cc ) ;
cc = strdup ( a - > account_ url ) ;
cc = strdup ( a - > account_ id ) ;
array_append ( & act - > cc , sizeof ( cc ) , & cc ) ;
account_free ( a ) ;
@ -130,14 +130,14 @@ struct ap_object* activity_create_Follow( struct account* follower, struct accou
struct ap_object * act = activity_new_local_activity ( ) ;
activity_allocate_local_id ( act ) ;
act - > id = aformat ( " https://%s/activity/%d " , g_server - > domain , act - > local_id ) ;
act - > actor = strdup ( follower - > account_ url ) ;
act - > actor = strdup ( follower - > account_ id ) ;
act - > type = ap_Follow ;
act - > published = time ( NULL ) ;
act - > object . tag = apaot_ref ;
act - > state = strdup ( " pending " ) ;
act - > object . ref = strdup ( following - > account_ url ) ;
act - > object . ref = strdup ( following - > account_ id ) ;
char * to = strdup ( following - > account_ url ) ;
char * to = strdup ( following - > account_ id ) ;
array_append ( & act - > to , sizeof ( to ) , & to ) ;
return act ;
@ -199,7 +199,7 @@ struct ap_object* activity_create_Like( struct status* s )
struct ap_object * act = activity_new_local_activity ( ) ;
activity_allocate_local_id ( act ) ;
act - > id = aformat ( " https://%s/activity/%d " , g_server - > domain , act - > local_id ) ;
act - > actor = strdup ( a - > account_ url ) ;
act - > actor = strdup ( a - > account_ id ) ;
act - > type = ap_Like ;
act - > published = time ( NULL ) ;
act - > object . tag = apaot_ref ;
@ -207,11 +207,11 @@ struct ap_object* activity_create_Like( struct status* s )
char * to = aformat ( " https://%s/owner/followers " , g_server - > domain ) ;
array_append ( & act - > to , sizeof ( to ) , & to ) ;
to = strdup ( a - > account_ url ) ;
to = strdup ( a - > account_ id ) ;
array_append ( & act - > to , sizeof ( to ) , & to ) ;
for ( int i = 0 ; i < s - > mentions . count ; + + i ) {
struct account * mentioned = account_from_id ( s - > mentions . items [ i ] ) ;
to = strdup ( mentioned - > account_ url ) ;
to = strdup ( mentioned - > account_ id ) ;
array_append ( & act - > to , sizeof ( to ) , & to ) ;
account_free ( mentioned ) ;
}
@ -266,8 +266,8 @@ struct ap_object* activity_create_Note( struct status* s )
/* set account related parameters */ {
struct account * a = account_from_id ( s - > account_id ) ;
act - > actor = strdup ( a - > account_ url ) ;
act - > attributed_to = strdup ( a - > account_ url ) ;
act - > actor = strdup ( a - > account_ id ) ;
act - > attributed_to = strdup ( a - > account_ id ) ;
account_free ( a ) ;
}
@ -334,14 +334,14 @@ struct ap_object* activity_create_Note( struct status* s )
for ( int i = 0 ; i < s - > mentions . count ; + + i ) {
struct account * mentioned = account_from_id ( s - > mentions . items [ i ] ) ;
str = strdup ( mentioned - > account_ url ) ;
str = strdup ( mentioned - > account_ id ) ;
array_append ( & act - > to , sizeof ( str ) , & str ) ;
struct ap_activity_tag * tag ;
tag = malloc ( sizeof ( * tag ) ) ;
memset ( tag , 0 , sizeof ( * tag ) ) ;
tag - > type = aptag_mention ;
tag - > href = strdup ( mentioned - > account_ url ) ;
tag - > href = strdup ( mentioned - > account_ id ) ;
tag - > name = aformat ( " %s@%s " , mentioned - > handle , mentioned - > server ) ;
array_append ( & act - > tags , sizeof ( tag ) , & tag ) ;