From 9d7ae694a8cacf12b3b0c9575e2fbcdd30aef606 Mon Sep 17 00:00:00 2001 From: Trinity Pointard Date: Sat, 27 Oct 2018 22:17:06 +0200 Subject: [PATCH] Delete notification on post deletion --- plume-models/src/posts.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index c0a32133..13af02d6 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -475,6 +475,9 @@ impl Deletable for Post { act.object_props.set_id_string(format!("{}#delete", self.ap_url)).expect("Post::delete: id error"); act.object_props.set_to_link_vec(vec![Id::new(PUBLIC_VISIBILTY)]).expect("Post::delete: to error"); + for m in Mention::list_for_post(&conn, self.id) { + m.delete(conn); + } diesel::delete(self).execute(conn).expect("Post::delete: DB error"); act }