From: Dessalines Date: Sat, 7 Dec 2019 06:43:20 +0000 (-0800) Subject: Show removed posts in users history. X-Git-Url: http://these/git/%7B%60/feeds/static/%24%7Bargs.pageFn.next%7D?a=commitdiff_plain;h=43d32d516b8d63251c02faba0e8621dde2da387d;p=lemmy.git Show removed posts in users history. - Fixes #354 --- diff --git a/server/src/db/post_view.rs b/server/src/db/post_view.rs index 51dea027..e4e3c16d 100644 --- a/server/src/db/post_view.rs +++ b/server/src/db/post_view.rs @@ -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::(conn) }