]> Untitled Git - lemmy.git/commitdiff
Dont show deleted / removed replies or messages in inbox. Fixes #493
authorDessalines <tyhou13@gmx.com>
Sun, 2 Feb 2020 22:07:16 +0000 (17:07 -0500)
committerDessalines <tyhou13@gmx.com>
Sun, 2 Feb 2020 22:07:16 +0000 (17:07 -0500)
server/src/db/comment_view.rs
server/src/db/private_message_view.rs

index d4a65c9a9703508ee42848f0734fed1cf0871d74..febf18b78c5305e73533db78450369abc3c8154b 100644 (file)
@@ -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));
index 59a573f4cca4008be4b4f13e08e7688f1f114c6e..e22bef50e7665f4e85d8be89b97e3aee6f5fb6cd 100644 (file)
@@ -98,7 +98,7 @@ impl<'a> PrivateMessageQueryBuilder<'a> {
   pub fn list(self) -> Result<Vec<PrivateMessageView>, 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 {