Reset repost and reply visibility settings after unfollowing
This commit is contained in:
parent
65661698c7
commit
ec349afc80
1 changed files with 5 additions and 2 deletions
|
@ -125,10 +125,13 @@ pub async fn unfollow(
|
||||||
return Err(DatabaseError::NotFound("relationship"));
|
return Err(DatabaseError::NotFound("relationship"));
|
||||||
};
|
};
|
||||||
if relationship_deleted {
|
if relationship_deleted {
|
||||||
// Update counters only if relationship exists
|
// Also reset repost and reply visibility settings
|
||||||
|
show_reposts(&transaction, source_id, target_id).await?;
|
||||||
|
show_replies(&transaction, source_id, target_id).await?;
|
||||||
|
// Update counters only if relationship existed
|
||||||
update_follower_count(&transaction, target_id, -1).await?;
|
update_follower_count(&transaction, target_id, -1).await?;
|
||||||
update_following_count(&transaction, source_id, -1).await?;
|
update_following_count(&transaction, source_id, -1).await?;
|
||||||
}
|
};
|
||||||
transaction.commit().await?;
|
transaction.commit().await?;
|
||||||
Ok(follow_request_deleted)
|
Ok(follow_request_deleted)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue