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

- Fixes #2471
http-signature-compat
Dessalines 2 years ago committed by GitHub
parent ee41654394
commit 3f8c28b26f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}

@ -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)
}

Loading…
Cancel
Save