]> Untitled Git - lemmy.git/commitdiff
Check to make sure comment isnt deleted / removed for unread count. (#2472)
authorDessalines <dessalines@users.noreply.github.com>
Thu, 29 Sep 2022 20:52:14 +0000 (16:52 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2022 20:52:14 +0000 (20:52 +0000)
- Fixes #2471

crates/db_views_actor/src/comment_reply_view.rs
crates/db_views_actor/src/person_mention_view.rs

index 39ba74ccb2e6dd50fe7b44c4a9671498b1cef057..c67941628197f2e842484515a089f2962dbce79f 100644 (file)
@@ -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::<i64>(conn)
   }
index e4863db4281fdcd469e74346b8e9202cdd4a28ba..2b6daf5dc8ea2f5e0b447e7aced445798b7432db 100644 (file)
@@ -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::<i64>(conn)
   }