mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 20:31:19 +00:00
Reordering filters to fix unread replies.
This commit is contained in:
parent
816545cf9c
commit
7041fae5dd
1 changed files with 6 additions and 6 deletions
|
@ -209,18 +209,18 @@ impl CommentView {
|
||||||
.and(community_block::person_id.eq(my_person_id)),
|
.and(community_block::person_id.eq(my_person_id)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.filter(comment::read.eq(false))
|
|
||||||
.filter(comment::deleted.eq(false))
|
|
||||||
.filter(comment::removed.eq(false))
|
|
||||||
// Don't show blocked communities or persons
|
|
||||||
.filter(community_block::person_id.is_null())
|
|
||||||
.filter(person_block::person_id.is_null())
|
|
||||||
.filter(person_alias_1::id.eq(my_person_id)) // Gets the comment replies
|
.filter(person_alias_1::id.eq(my_person_id)) // Gets the comment replies
|
||||||
.or_filter(
|
.or_filter(
|
||||||
comment::parent_id
|
comment::parent_id
|
||||||
.is_null()
|
.is_null()
|
||||||
.and(post::creator_id.eq(my_person_id)),
|
.and(post::creator_id.eq(my_person_id)),
|
||||||
) // Gets the top level replies
|
) // Gets the top level replies
|
||||||
|
.filter(comment::read.eq(false))
|
||||||
|
.filter(comment::deleted.eq(false))
|
||||||
|
.filter(comment::removed.eq(false))
|
||||||
|
// Don't show blocked communities or persons
|
||||||
|
.filter(community_block::person_id.is_null())
|
||||||
|
.filter(person_block::person_id.is_null())
|
||||||
.select(count(comment::id))
|
.select(count(comment::id))
|
||||||
.first::<i64>(conn)
|
.first::<i64>(conn)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue