From 0200a7b2239900043484931047eda97ca23721b7 Mon Sep 17 00:00:00 2001 From: Bat Date: Wed, 12 Sep 2018 17:00:00 +0100 Subject: [PATCH] Only send notifications for mentions if the post is not a draft --- src/routes/posts.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/posts.rs b/src/routes/posts.rs index c85fcaf1..29ce308c 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -200,8 +200,10 @@ fn update(blog: String, slug: String, user: User, conn: DbConn, data: LenientFor post.update(&*conn); let post = post.update_ap_url(&*conn); - for m in mentions.into_iter() { - Mention::from_activity(&*conn, Mention::build_activity(&*conn, m), post.id, true, true); + if post.published { + for m in mentions.into_iter() { + Mention::from_activity(&*conn, Mention::build_activity(&*conn, m), post.id, true, true); + } } let old_tags = Tag::for_post(&*conn, post.id).into_iter().map(|t| t.tag).collect::>();