Ignore Undo(Follow) if relationship doesn't exist
This commit is contained in:
parent
5e7d3ab434
commit
61f0c5a546
1 changed files with 6 additions and 1 deletions
|
@ -351,7 +351,12 @@ pub async fn receive_activity(
|
||||||
.ok_or(ValidationError("invalid object"))?;
|
.ok_or(ValidationError("invalid object"))?;
|
||||||
let target_username = parse_actor_id(&config.instance_url(), &target_actor_id)?;
|
let target_username = parse_actor_id(&config.instance_url(), &target_actor_id)?;
|
||||||
let target_profile = get_profile_by_acct(db_client, &target_username).await?;
|
let target_profile = get_profile_by_acct(db_client, &target_username).await?;
|
||||||
unfollow(db_client, &source_profile.id, &target_profile.id).await?;
|
match unfollow(db_client, &source_profile.id, &target_profile.id).await {
|
||||||
|
Ok(_) => (),
|
||||||
|
// Ignore Undo if relationship doesn't exist
|
||||||
|
Err(DatabaseError::NotFound(_)) => return Ok(()),
|
||||||
|
Err(other_error) => return Err(other_error.into()),
|
||||||
|
};
|
||||||
FOLLOW
|
FOLLOW
|
||||||
},
|
},
|
||||||
(UNDO, _) => {
|
(UNDO, _) => {
|
||||||
|
|
Loading…
Reference in a new issue