Add user actions to statuses in search results
This commit is contained in:
parent
496db34e45
commit
54c32c5f00
1 changed files with 5 additions and 1 deletions
|
@ -11,7 +11,10 @@ use crate::config::Config;
|
||||||
use crate::errors::{ValidationError, HttpError};
|
use crate::errors::{ValidationError, HttpError};
|
||||||
use crate::mastodon_api::accounts::types::Account;
|
use crate::mastodon_api::accounts::types::Account;
|
||||||
use crate::mastodon_api::statuses::types::Status;
|
use crate::mastodon_api::statuses::types::Status;
|
||||||
use crate::models::posts::helpers::can_view_post;
|
use crate::models::posts::helpers::{
|
||||||
|
can_view_post,
|
||||||
|
get_actions_for_posts,
|
||||||
|
};
|
||||||
use crate::models::posts::types::Post;
|
use crate::models::posts::types::Post;
|
||||||
use crate::models::profiles::queries::{
|
use crate::models::profiles::queries::{
|
||||||
search_profile,
|
search_profile,
|
||||||
|
@ -155,6 +158,7 @@ pub async fn search(
|
||||||
let accounts: Vec<Account> = profiles.into_iter()
|
let accounts: Vec<Account> = profiles.into_iter()
|
||||||
.map(|profile| Account::from_profile(profile, &config.instance_url()))
|
.map(|profile| Account::from_profile(profile, &config.instance_url()))
|
||||||
.collect();
|
.collect();
|
||||||
|
get_actions_for_posts(db_client, ¤t_user.id, posts.iter_mut().collect()).await?;
|
||||||
let statuses: Vec<Status> = posts.into_iter()
|
let statuses: Vec<Status> = posts.into_iter()
|
||||||
.map(|post| Status::from_post(post, &config.instance_url()))
|
.map(|post| Status::from_post(post, &config.instance_url()))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
Loading…
Reference in a new issue