From 3f8c28b26f0bbed3bd67d0e8190567bdf0fd8665 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 29 Sep 2022 16:52:14 -0400 Subject: [PATCH] Check to make sure comment isnt deleted / removed for unread count. (#2472) - Fixes #2471 --- crates/db_views_actor/src/comment_reply_view.rs | 3 +++ crates/db_views_actor/src/person_mention_view.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/crates/db_views_actor/src/comment_reply_view.rs b/crates/db_views_actor/src/comment_reply_view.rs index 39ba74cc..c6794162 100644 --- a/crates/db_views_actor/src/comment_reply_view.rs +++ b/crates/db_views_actor/src/comment_reply_view.rs @@ -154,8 +154,11 @@ impl CommentReplyView { use diesel::dsl::*; comment_reply::table + .inner_join(comment::table) .filter(comment_reply::recipient_id.eq(my_person_id)) .filter(comment_reply::read.eq(false)) + .filter(comment::deleted.eq(false)) + .filter(comment::removed.eq(false)) .select(count(comment_reply::id)) .first::(conn) } diff --git a/crates/db_views_actor/src/person_mention_view.rs b/crates/db_views_actor/src/person_mention_view.rs index e4863db4..2b6daf5d 100644 --- a/crates/db_views_actor/src/person_mention_view.rs +++ b/crates/db_views_actor/src/person_mention_view.rs @@ -157,8 +157,11 @@ impl PersonMentionView { use diesel::dsl::*; person_mention::table + .inner_join(comment::table) .filter(person_mention::recipient_id.eq(my_person_id)) .filter(person_mention::read.eq(false)) + .filter(comment::deleted.eq(false)) + .filter(comment::removed.eq(false)) .select(count(person_mention::id)) .first::(conn) } -- 2.44.1