Dont show deleted / removed replies or messages in inbox. Fixes #493

This commit is contained in:
Dessalines 2020-02-02 17:07:16 -05:00
parent cd57e612c1
commit 46727f72df
2 changed files with 4 additions and 2 deletions

View file

@ -348,7 +348,9 @@ impl<'a> ReplyQueryBuilder<'a> {
query = query query = query
.filter(user_id.eq(self.for_user_id)) .filter(user_id.eq(self.for_user_id))
.filter(recipient_id.eq(self.for_user_id)); .filter(recipient_id.eq(self.for_user_id))
.filter(deleted.eq(false))
.filter(removed.eq(false));
if self.unread_only { if self.unread_only {
query = query.filter(read.eq(false)); query = query.filter(read.eq(false));

View file

@ -98,7 +98,7 @@ impl<'a> PrivateMessageQueryBuilder<'a> {
pub fn list(self) -> Result<Vec<PrivateMessageView>, Error> { pub fn list(self) -> Result<Vec<PrivateMessageView>, Error> {
use super::private_message_view::private_message_mview::dsl::*; use super::private_message_view::private_message_mview::dsl::*;
let mut query = self.query; let mut query = self.query.filter(deleted.eq(false));
// If its unread, I only want the ones to me // If its unread, I only want the ones to me
if self.unread_only { if self.unread_only {