mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-25 01:10:32 +00:00
Fix deleted posts so they can only be seen by creator (#4182)
This commit is contained in:
parent
30f7135f32
commit
49377c195e
1 changed files with 7 additions and 5 deletions
|
@ -296,12 +296,14 @@ fn queries<'a>() -> Queries<
|
||||||
options.saved_only,
|
options.saved_only,
|
||||||
);
|
);
|
||||||
|
|
||||||
let is_creator = options.creator_id == options.local_user.map(|l| l.person.id);
|
// hide posts from deleted communities
|
||||||
|
query = query.filter(community::deleted.eq(false));
|
||||||
|
|
||||||
// only show deleted posts to creator
|
// only show deleted posts to creator
|
||||||
if is_creator {
|
if let Some(person_id) = person_id {
|
||||||
query = query
|
query = query.filter(post::deleted.eq(false).or(post::creator_id.eq(person_id)));
|
||||||
.filter(community::deleted.eq(false))
|
} else {
|
||||||
.filter(post::deleted.eq(false));
|
query = query.filter(post::deleted.eq(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
let is_admin = options
|
let is_admin = options
|
||||||
|
|
Loading…
Reference in a new issue