Check to make sure comment isnt deleted / removed for unread count. (#2472)

- Fixes #2471
This commit is contained in:
Dessalines 2022-09-29 16:52:14 -04:00 committed by GitHub
parent ee41654394
commit 3f8c28b26f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -154,8 +154,11 @@ impl CommentReplyView {
use diesel::dsl::*; use diesel::dsl::*;
comment_reply::table comment_reply::table
.inner_join(comment::table)
.filter(comment_reply::recipient_id.eq(my_person_id)) .filter(comment_reply::recipient_id.eq(my_person_id))
.filter(comment_reply::read.eq(false)) .filter(comment_reply::read.eq(false))
.filter(comment::deleted.eq(false))
.filter(comment::removed.eq(false))
.select(count(comment_reply::id)) .select(count(comment_reply::id))
.first::<i64>(conn) .first::<i64>(conn)
} }

View file

@ -157,8 +157,11 @@ impl PersonMentionView {
use diesel::dsl::*; use diesel::dsl::*;
person_mention::table person_mention::table
.inner_join(comment::table)
.filter(person_mention::recipient_id.eq(my_person_id)) .filter(person_mention::recipient_id.eq(my_person_id))
.filter(person_mention::read.eq(false)) .filter(person_mention::read.eq(false))
.filter(comment::deleted.eq(false))
.filter(comment::removed.eq(false))
.select(count(person_mention::id)) .select(count(person_mention::id))
.first::<i64>(conn) .first::<i64>(conn)
} }