listing_type: ListingType,
sort_type: SortType,
) -> Result<HttpResponse, LemmyError> {
- let site_view = blocking(context.pool(), move |conn| SiteView::read(&conn)).await??;
+ let site_view = blocking(context.pool(), move |conn| SiteView::read(conn)).await??;
let posts = blocking(context.pool(), move |conn| {
- PostQueryBuilder::create(&conn)
+ PostQueryBuilder::create(conn)
.listing_type(listing_type)
.sort(sort_type)
.list()
sort_type: &SortType,
user_name: String,
) -> Result<ChannelBuilder, LemmyError> {
- let site_view = SiteView::read(&conn)?;
- let person = Person::find_by_name(&conn, &user_name)?;
+ let site_view = SiteView::read(conn)?;
+ let person = Person::find_by_name(conn, &user_name)?;
- let posts = PostQueryBuilder::create(&conn)
+ let posts = PostQueryBuilder::create(conn)
.listing_type(ListingType::All)
.sort(*sort_type)
.creator_id(person.id)
sort_type: &SortType,
community_name: String,
) -> Result<ChannelBuilder, LemmyError> {
- let site_view = SiteView::read(&conn)?;
- let community = Community::read_from_name(&conn, &community_name)?;
+ let site_view = SiteView::read(conn)?;
+ let community = Community::read_from_name(conn, &community_name)?;
- let posts = PostQueryBuilder::create(&conn)
+ let posts = PostQueryBuilder::create(conn)
.listing_type(ListingType::All)
.sort(*sort_type)
.community_id(community.id)
sort_type: &SortType,
jwt: String,
) -> Result<ChannelBuilder, LemmyError> {
- let site_view = SiteView::read(&conn)?;
+ let site_view = SiteView::read(conn)?;
let local_user_id = LocalUserId(Claims::decode(&jwt)?.claims.sub);
- let local_user = LocalUser::read(&conn, local_user_id)?;
+ let local_user = LocalUser::read(conn, local_user_id)?;
let person_id = local_user.person_id;
let show_bot_accounts = local_user.show_bot_accounts;
let show_read_posts = local_user.show_read_posts;
- let posts = PostQueryBuilder::create(&conn)
+ let posts = PostQueryBuilder::create(conn)
.listing_type(ListingType::Subscribed)
.my_person_id(person_id)
.show_bot_accounts(show_bot_accounts)
}
fn get_feed_inbox(conn: &PgConnection, jwt: String) -> Result<ChannelBuilder, LemmyError> {
- let site_view = SiteView::read(&conn)?;
+ let site_view = SiteView::read(conn)?;
let local_user_id = LocalUserId(Claims::decode(&jwt)?.claims.sub);
- let local_user = LocalUser::read(&conn, local_user_id)?;
+ let local_user = LocalUser::read(conn, local_user_id)?;
let person_id = local_user.person_id;
let show_bot_accounts = local_user.show_bot_accounts;
let sort = SortType::New;
- let replies = CommentQueryBuilder::create(&conn)
+ let replies = CommentQueryBuilder::create(conn)
.recipient_id(person_id)
.my_person_id(person_id)
.show_bot_accounts(show_bot_accounts)
.sort(sort)
.list()?;
- let mentions = PersonMentionQueryBuilder::create(&conn)
+ let mentions = PersonMentionQueryBuilder::create(conn)
.recipient_id(person_id)
.my_person_id(person_id)
.sort(sort)