don't treat already-not-following as error
This commit is contained in:
parent
61f0883841
commit
465919792f
|
@ -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) {
|
pub async fn unfollow_if_following(remote_peer: &str) {
|
||||||
if let Ok(whoami) = whoami().await {
|
if let Ok(whoami) = whoami().await {
|
||||||
match is_following(&whoami, remote_peer).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" => {
|
Ok(status) if status.as_str() == "true" => {
|
||||||
info!("Unfollowing peer {}", &remote_peer);
|
info!("Unfollowing peer {}", &remote_peer);
|
||||||
match unfollow_peer(remote_peer).await {
|
match unfollow_peer(remote_peer).await {
|
||||||
|
|
|
@ -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> {
|
pub async fn unfollow_if_following(remote_peer: &str) -> Result<(), String> {
|
||||||
if let Ok(whoami) = whoami().await {
|
if let Ok(whoami) = whoami().await {
|
||||||
match is_following(&whoami, remote_peer).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" => {
|
Ok(status) if status.as_str() == "true" => {
|
||||||
info!("Unfollowing peer {}", &remote_peer);
|
info!("Unfollowing peer {}", &remote_peer);
|
||||||
match unfollow_peer(remote_peer).await {
|
match unfollow_peer(remote_peer).await {
|
||||||
|
|
Loading…
Reference in New Issue