From: Dessalines Date: Thu, 14 Oct 2021 17:03:12 +0000 (-0400) Subject: Fix saved posts and hide read posts issue. Fixes #1839 (#1840) X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%22https:/hacktivis.me/%7Bthis.getImageSrc%28%29%7D?a=commitdiff_plain;h=ccb8e4b4149afc8f8692a99342d93515a483efae;p=lemmy.git Fix saved posts and hide read posts issue. Fixes #1839 (#1840) --- diff --git a/crates/db_views/src/post_view.rs b/crates/db_views/src/post_view.rs index ec537ad9..dc55e6ec 100644 --- a/crates/db_views/src/post_view.rs +++ b/crates/db_views/src/post_view.rs @@ -399,13 +399,14 @@ impl<'a> PostQueryBuilder<'a> { query = query.filter(person::bot_account.eq(false)); }; - if !self.show_read_posts.unwrap_or(true) { - query = query.filter(post_read::id.is_null()); - }; - if self.saved_only.unwrap_or(false) { query = query.filter(post_saved::id.is_not_null()); - }; + } + // Only hide the read posts, if the saved_only is false. Otherwise ppl with the hide_read + // setting wont be able to see saved posts. + else if !self.show_read_posts.unwrap_or(true) { + query = query.filter(post_read::id.is_null()); + } // Don't show blocked communities or persons if self.my_person_id.is_some() {