Fill in root_status_id and add to parent's reply list, handle unable to fetch parent (this should be a stub)

master
teknomunk 1 year ago
parent 80a0278495
commit a91eee9eeb

@ -182,8 +182,23 @@ bool status_sync_from_activity_pub( struct status* s, struct ap_activity* act )
if( act->in_reply_to ) {
struct status* parent = status_from_uri_or_fetch( act->in_reply_to );
s->in_reply_to = parent->id;
status_free(parent);
if( parent ) {
s->in_reply_to = parent->id;
s->root_status_id = parent->root_status_id;
bool is_already_parent_reply = false;
for( int i = 0; i < parent->replies.count; ++i ) {
if( parent->replies.items[i] == s->id ) {
is_already_parent_reply = true;
}
}
if( !is_already_parent_reply ) {
int id = s->id;
array_append( &parent->replies, sizeof(id), &id );
status_save(parent);
}
status_free(parent);
}
}
for( int i = 0; i < act->tags.count; ++i ) {
struct ap_activity_tag* tag = act->tags.items[i];

Loading…
Cancel
Save