From e4ee8090b9960fac55528bf20e22e5d84a7de99d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 4 May 2020 14:26:16 -0400 Subject: [PATCH] Renaming ignore to unfollow in followable trait. --- server/src/api/community.rs | 4 ++-- server/src/apub/community_inbox.rs | 2 +- server/src/db/community.rs | 4 ++-- server/src/db/mod.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/api/community.rs b/server/src/api/community.rs index 9855b7887..55c55ee12 100644 --- a/server/src/api/community.rs +++ b/server/src/api/community.rs @@ -495,7 +495,7 @@ impl Perform for Oper { Err(_e) => return Err(APIError::err("community_follower_already_exists").into()), }; } else { - match CommunityFollower::ignore(&conn, &community_follower_form) { + match CommunityFollower::unfollow(&conn, &community_follower_form) { Ok(user) => user, Err(_e) => return Err(APIError::err("community_follower_already_exists").into()), }; @@ -509,7 +509,7 @@ impl Perform for Oper { user.send_follow(&community.actor_id, &conn)?; } else { user.send_unfollow(&community.actor_id, &conn)?; - match CommunityFollower::ignore(&conn, &community_follower_form) { + match CommunityFollower::unfollow(&conn, &community_follower_form) { Ok(user) => user, Err(_e) => return Err(APIError::err("community_follower_already_exists").into()), }; diff --git a/server/src/apub/community_inbox.rs b/server/src/apub/community_inbox.rs index 0aec5ff6e..450172501 100644 --- a/server/src/apub/community_inbox.rs +++ b/server/src/apub/community_inbox.rs @@ -129,7 +129,7 @@ fn handle_undo_follow( user_id: user.id, }; - CommunityFollower::ignore(&conn, &community_follower_form).ok(); + CommunityFollower::unfollow(&conn, &community_follower_form).ok(); Ok(HttpResponse::Ok().finish()) } diff --git a/server/src/db/community.rs b/server/src/db/community.rs index 0f324de29..9b858fde3 100644 --- a/server/src/db/community.rs +++ b/server/src/db/community.rs @@ -216,7 +216,7 @@ impl Followable for CommunityFollower { .values(community_follower_form) .get_result::(conn) } - fn ignore( + fn unfollow( conn: &PgConnection, community_follower_form: &CommunityFollowerForm, ) -> Result { @@ -351,7 +351,7 @@ mod tests { let read_community = Community::read(&conn, inserted_community.id).unwrap(); let updated_community = Community::update(&conn, inserted_community.id, &new_community).unwrap(); - let ignored_community = CommunityFollower::ignore(&conn, &community_follower_form).unwrap(); + let ignored_community = CommunityFollower::unfollow(&conn, &community_follower_form).unwrap(); let left_community = CommunityModerator::leave(&conn, &community_user_form).unwrap(); let unban = CommunityUserBan::unban(&conn, &community_user_ban_form).unwrap(); let num_deleted = Community::delete(&conn, inserted_community.id).unwrap(); diff --git a/server/src/db/mod.rs b/server/src/db/mod.rs index e8240970d..ed334b8c7 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -44,7 +44,7 @@ pub trait Followable { fn follow(conn: &PgConnection, form: &T) -> Result where Self: Sized; - fn ignore(conn: &PgConnection, form: &T) -> Result + fn unfollow(conn: &PgConnection, form: &T) -> Result where Self: Sized; }