Use activity ID to identify remote reposts

This commit is contained in:
silverpill 2021-12-07 11:45:13 +00:00
parent 6087e78abb
commit be2201f7b6

View file

@ -334,13 +334,13 @@ pub async fn receive_activity(
Ok(post_id) => post_id, Ok(post_id) => post_id,
Err(_) => { Err(_) => {
// Try to get remote post // Try to get remote post
let post = process_note(config, db_client, object_id.clone(), None).await?; let post = process_note(config, db_client, object_id, None).await?;
post.id post.id
}, },
}; };
let repost_data = PostCreateData { let repost_data = PostCreateData {
repost_of_id: Some(post_id), repost_of_id: Some(post_id),
object_id: Some(object_id), object_id: Some(activity.id),
..Default::default() ..Default::default()
}; };
create_post(db_client, &author.id, repost_data).await?; create_post(db_client, &author.id, repost_data).await?;