diff --git a/part_3_database_follows/README.md b/part_3_database_follows/README.md index 53a4c3b..14fb638 100644 --- a/part_3_database_follows/README.md +++ b/part_3_database_follows/README.md @@ -323,6 +323,14 @@ pub async fn follow_if_not_following(remote_peer: &str) -> Result<(), String> { pub async fn unfollow_if_following(remote_peer: &str) { if let Ok(whoami) = whoami().await { match is_following(&whoami, remote_peer).await { + Ok(status) if status.as_str() == "false" => { + info!( + "Not currently following peer {}. No further action taken", + &remote_peer + ); + + Ok(()) + } Ok(status) if status.as_str() == "true" => { info!("Unfollowing peer {}", &remote_peer); match unfollow_peer(remote_peer).await { diff --git a/part_3_database_follows/src/sbot.rs b/part_3_database_follows/src/sbot.rs index 32300be..c874c85 100644 --- a/part_3_database_follows/src/sbot.rs +++ b/part_3_database_follows/src/sbot.rs @@ -103,6 +103,13 @@ pub async fn follow_if_not_following(remote_peer: &str) -> Result<(), String> { pub async fn unfollow_if_following(remote_peer: &str) -> Result<(), String> { if let Ok(whoami) = whoami().await { match is_following(&whoami, remote_peer).await { + Ok(status) if status.as_str() == "false" => { + info!( + "Not currently following peer {}. No further action taken", + &remote_peer + ); + Ok(()) + } Ok(status) if status.as_str() == "true" => { info!("Unfollowing peer {}", &remote_peer); match unfollow_peer(remote_peer).await {