mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-05 04:40:39 +00:00
Indicate pinned posts on user profiles (close #606)
This commit is contained in:
parent
501b47894c
commit
3f3d9e9c3b
4 changed files with 27 additions and 37 deletions
|
@ -155,7 +155,8 @@ async fn parse_post(json: &serde_json::Value) -> Post {
|
|||
},
|
||||
flags: Flags {
|
||||
nsfw: post["data"]["over_18"].as_bool().unwrap_or(false),
|
||||
stickied: post["data"]["stickied"].as_bool().unwrap_or(false),
|
||||
stickied: post["data"]["stickied"].as_bool().unwrap_or(false)
|
||||
|| post["data"]["pinned"].as_bool().unwrap_or(false),
|
||||
},
|
||||
domain: val(post, "domain"),
|
||||
rel_time,
|
||||
|
|
|
@ -319,7 +319,7 @@ impl Post {
|
|||
},
|
||||
flags: Flags {
|
||||
nsfw: data["over_18"].as_bool().unwrap_or_default(),
|
||||
stickied: data["stickied"].as_bool().unwrap_or_default(),
|
||||
stickied: data["stickied"].as_bool().unwrap_or_default() || data["pinned"].as_bool().unwrap_or_default(),
|
||||
},
|
||||
permalink: val(post, "permalink"),
|
||||
rel_time,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue