]> Untitled Git - lemmy.git/commitdiff
Renaming ignore to unfollow in followable trait.
authorDessalines <tyhou13@gmx.com>
Mon, 4 May 2020 18:26:16 +0000 (14:26 -0400)
committerDessalines <tyhou13@gmx.com>
Mon, 4 May 2020 18:26:16 +0000 (14:26 -0400)
server/src/api/community.rs
server/src/apub/community_inbox.rs
server/src/db/community.rs
server/src/db/mod.rs

index 9855b78871b5607df76f4d60ad7a7bcd7314601e..55c55ee12b3983e7f39d3619ab7d357ebf334604 100644 (file)
@@ -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()),
         };
index 0aec5ff6e367c206641eeca9d4fe6cda01840161..45017250198163704b4fccd3b50946676b1b5aab 100644 (file)
@@ -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())
 }
index 0f324de29d168a078766d8f12b5e94dcd41c4c5a..9b858fde349232ff87b966d1231ceb099025f2a0 100644 (file)
@@ -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();
index e8240970dc04b2d310c951d97abefb2dd5e8d064..ed334b8c7bc6c698a27b68e9c1add9269a9bc5fa 100644 (file)
@@ -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;
 }