Ok(())
}
-/// A helper method for showing the bot account
-pub fn user_show_bot_accounts(local_user_view: &Option<LocalUserView>) -> bool {
- match local_user_view {
- Some(uv) => uv.to_owned().local_user.show_bot_accounts,
- None => true,
- }
-}
-
-/// A helper method for showing nsfw
-pub fn user_show_nsfw(local_user_view: &Option<LocalUserView>) -> bool {
- match &local_user_view {
- Some(uv) => uv.local_user.show_nsfw,
- None => false,
- }
-}
-
-/// A helper method for showing read posts
-pub fn user_show_read_posts(local_user_view: &Option<LocalUserView>) -> bool {
- match local_user_view {
- Some(uv) => uv.to_owned().local_user.show_read_posts,
- None => true,
- }
-}
-
pub async fn get_post(post_id: PostId, pool: &DbPool) -> Result<Post, LemmyError> {
blocking(pool, move |conn| Post::read(conn, post_id))
.await?