diff options
author | Dessalines <tyhou13@gmx.com> | 2020-05-04 14:26:16 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-05-04 14:26:16 -0400 |
commit | b177cbce1d8f40b9eb514e210a66798aabcbae09 (patch) | |
tree | f0cf867a4ced0bbdb531fd69207c4c1aa87ea7cc | |
parent | b8b2398d32908c982635070ce1ce58eee504dc1d (diff) |
Renaming ignore to unfollow in followable trait.
-rw-r--r-- | server/src/api/community.rs | 4 | ||||
-rw-r--r-- | server/src/apub/community_inbox.rs | 2 | ||||
-rw-r--r-- | server/src/db/community.rs | 4 | ||||
-rw-r--r-- | 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 9855b788..55c55ee1 100644 --- a/server/src/api/community.rs +++ b/server/src/api/community.rs @@ -495,7 +495,7 @@ impl Perform for Oper<FollowCommunity> { 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<FollowCommunity> { 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 0aec5ff6..45017250 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 0f324de2..9b858fde 100644 --- a/server/src/db/community.rs +++ b/server/src/db/community.rs @@ -216,7 +216,7 @@ impl Followable<CommunityFollowerForm> for CommunityFollower { .values(community_follower_form) .get_result::<Self>(conn) } - fn ignore( + fn unfollow( conn: &PgConnection, community_follower_form: &CommunityFollowerForm, ) -> Result<usize, Error> { @@ -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 e8240970..ed334b8c 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -44,7 +44,7 @@ pub trait Followable<T> { fn follow(conn: &PgConnection, form: &T) -> Result<Self, Error> where Self: Sized; - fn ignore(conn: &PgConnection, form: &T) -> Result<usize, Error> + fn unfollow(conn: &PgConnection, form: &T) -> Result<usize, Error> where Self: Sized; } |