From: Dessalines Date: Thu, 29 Sep 2022 20:52:14 +0000 (-0400) Subject: Check to make sure comment isnt deleted / removed for unread count. (#2472) X-Git-Url: http://these/git/%22https:/www.exeterceilidhs.net/static/%7BlocalRss%7D?a=commitdiff_plain;h=3f8c28b26f0bbed3bd67d0e8190567bdf0fd8665;p=lemmy.git Check to make sure comment isnt deleted / removed for unread count. (#2472) - Fixes #2471 --- 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) }