]> Untitled Git - lemmy.git/commitdiff
Show removed posts in users history.
authorDessalines <tyhou13@gmx.com>
Sat, 7 Dec 2019 06:43:20 +0000 (22:43 -0800)
committerDessalines <tyhou13@gmx.com>
Sat, 7 Dec 2019 06:43:20 +0000 (22:43 -0800)
- Fixes #354

server/src/db/post_view.rs

index 51dea027fd13eacf7b7fd7112ec48f3cc89e65f7..e4e3c16d0897d6f922a703c27c2269007bcb69f6 100644 (file)
@@ -95,8 +95,15 @@ impl PostView {
 
     let mut query = post_view.into_boxed();
 
+    // If its for a specific user, show the removed / deleted
     if let Some(for_creator_id) = for_creator_id {
       query = query.filter(creator_id.eq(for_creator_id));
+    } else {
+      query = query
+        .filter(removed.eq(false))
+        .filter(deleted.eq(false))
+        .filter(community_removed.eq(false))
+        .filter(community_deleted.eq(false));
     };
 
     if let Some(search_term) = search_term {
@@ -161,13 +168,7 @@ impl PostView {
         .then_order_by(score.desc()),
     };
 
-    query = query
-      .limit(limit)
-      .offset(offset)
-      .filter(removed.eq(false))
-      .filter(deleted.eq(false))
-      .filter(community_removed.eq(false))
-      .filter(community_deleted.eq(false));
+    query = query.limit(limit).offset(offset);
 
     query.load::<Self>(conn)
   }