Fixes and improvements courtesy of Daan (black-puppydog) #6

Merged
glyph merged 13 commits from black_puppydog_fixes into main 2022-10-02 16:43:03 +00:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit 465919792f - Show all commits

View File

@ -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 {

View File

@ -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 {