From 36c451e7c03d7ed76d023bab2172fb3d8bf4464d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 2 Feb 2020 17:07:16 -0500 Subject: [PATCH] Dont show deleted / removed replies or messages in inbox. Fixes #493 --- server/src/db/comment_view.rs | 4 +++- server/src/db/private_message_view.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/db/comment_view.rs b/server/src/db/comment_view.rs index d4a65c9a..febf18b7 100644 --- a/server/src/db/comment_view.rs +++ b/server/src/db/comment_view.rs @@ -348,7 +348,9 @@ impl<'a> ReplyQueryBuilder<'a> { query = query .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 { query = query.filter(read.eq(false)); diff --git a/server/src/db/private_message_view.rs b/server/src/db/private_message_view.rs index 59a573f4..e22bef50 100644 --- a/server/src/db/private_message_view.rs +++ b/server/src/db/private_message_view.rs @@ -98,7 +98,7 @@ impl<'a> PrivateMessageQueryBuilder<'a> { pub fn list(self) -> Result, Error> { 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 self.unread_only {