From: Dessalines Date: Mon, 4 May 2020 18:26:16 +0000 (-0400) Subject: Renaming ignore to unfollow in followable trait. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%22https:/hacktivis.me/%24%7Bsrc%7D?a=commitdiff_plain;h=b177cbce1d8f40b9eb514e210a66798aabcbae09;p=lemmy.git Renaming ignore to unfollow in followable trait. --- 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 { 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 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 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 e8240970..ed334b8c 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; }