Ignore Like(Note) if reaction already exists in database

This commit is contained in:
silverpill 2021-12-25 21:44:08 +00:00
parent 34b8d05f8b
commit 74a89f6fe9

View file

@ -492,12 +492,17 @@ pub async fn receive_activity(
post.id
},
};
create_reaction(
match create_reaction(
db_client,
&author.id,
&post_id,
Some(&activity.id),
).await?;
).await {
Ok(_) => (),
// Ignore activity if reaction is already saved
Err(DatabaseError::AlreadyExists(_)) => return Ok(()),
Err(other_error) => return Err(other_error.into()),
};
NOTE
},
(FOLLOW, _) => {