use actix_web::web::Data;
use diesel::NotFound;
use lemmy_api_common::{
- blocking,
- check_private_instance,
- get_local_user_view_from_jwt_opt,
site::{ResolveObject, ResolveObjectResponse},
+ utils::{blocking, check_private_instance, get_local_user_view_from_jwt_opt},
};
-use lemmy_apub::fetcher::search::{search_by_apub_id, SearchableObjects};
-use lemmy_db_schema::{newtypes::PersonId, DbPool};
-use lemmy_db_views::{comment_view::CommentView, post_view::PostView};
-use lemmy_db_views_actor::{community_view::CommunityView, person_view::PersonViewSafe};
-use lemmy_utils::{ConnectionId, LemmyError};
+use lemmy_apub::fetcher::search::{search_query_to_object_id, SearchableObjects};
+use lemmy_db_schema::{newtypes::PersonId, utils::DbPool};
+use lemmy_db_views::structs::{CommentView, PostView};
+use lemmy_db_views_actor::structs::{CommunityView, PersonViewSafe};
+use lemmy_utils::{error::LemmyError, ConnectionId};
use lemmy_websocket::LemmyContext;
#[async_trait::async_trait(?Send)]
.await?;
check_private_instance(&local_user_view, context.pool()).await?;
- let res = search_by_apub_id(&self.q, context)
+ let res = search_query_to_object_id(&self.q, local_user_view.is_none(), context)
.await
.map_err(|e| e.with_message("couldnt_find_object"))?;
convert_response(res, local_user_view.map(|l| l.person.id), context.pool())