diff --git a/crates/api_common/src/utils.rs b/crates/api_common/src/utils.rs index 6b0b011a9..8af58bfd3 100644 --- a/crates/api_common/src/utils.rs +++ b/crates/api_common/src/utils.rs @@ -763,21 +763,6 @@ pub async fn delete_user_account( } // No need to update avatar and banner, those are handled in Person::delete_account - // Comments - let permadelete = move |conn: &mut _| Comment::permadelete_for_creator(conn, person_id); - blocking(pool, permadelete) - .await? - .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_comment"))?; - - // Posts - let permadelete = move |conn: &mut _| Post::permadelete_for_creator(conn, person_id); - blocking(pool, permadelete) - .await? - .map_err(|e| LemmyError::from_error_message(e, "couldnt_update_post"))?; - - // Purge image posts - purge_image_posts_for_person(person_id, pool, settings, client).await?; - blocking(pool, move |conn| Person::delete_account(conn, person_id)).await??; Ok(()) diff --git a/crates/db_schema/src/impls/comment.rs b/crates/db_schema/src/impls/comment.rs index d056f1a28..c2cf5e0ab 100644 --- a/crates/db_schema/src/impls/comment.rs +++ b/crates/db_schema/src/impls/comment.rs @@ -17,20 +17,6 @@ use diesel_ltree::Ltree; use url::Url; impl Comment { - pub fn permadelete_for_creator( - conn: &mut PgConnection, - for_creator_id: PersonId, - ) -> Result, Error> { - use crate::schema::comment::dsl::*; - diesel::update(comment.filter(creator_id.eq(for_creator_id))) - .set(( - content.eq("*Permananently Deleted*"), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - pub fn update_removed_for_creator( conn: &mut PgConnection, for_creator_id: PersonId, diff --git a/crates/db_schema/src/impls/post.rs b/crates/db_schema/src/impls/post.rs index 95535b194..5141ae44a 100644 --- a/crates/db_schema/src/impls/post.rs +++ b/crates/db_schema/src/impls/post.rs @@ -69,26 +69,6 @@ impl Post { .load::(conn) } - pub fn permadelete_for_creator( - conn: &mut PgConnection, - for_creator_id: PersonId, - ) -> Result, Error> { - use crate::schema::post::dsl::*; - - let perma_deleted = "*Permananently Deleted*"; - let perma_deleted_url = "https://deleted.com"; - - diesel::update(post.filter(creator_id.eq(for_creator_id))) - .set(( - name.eq(perma_deleted), - url.eq(perma_deleted_url), - body.eq(perma_deleted), - deleted.eq(true), - updated.eq(naive_now()), - )) - .get_results::(conn) - } - pub fn update_removed_for_creator( conn: &mut PgConnection, for_creator_id: PersonId,