use imports

no-overwrite-local
Felix Ableitner 2024-04-09 17:03:39 +02:00
parent f89e8b90e8
commit ef50b697bd
1 changed files with 4 additions and 2 deletions

View File

@ -3,11 +3,13 @@ use activitypub_federation::{
config::Data, config::Data,
fetch::object_id::ObjectId, fetch::object_id::ObjectId,
protocol::values::MediaTypeMarkdownOrHtml, protocol::values::MediaTypeMarkdownOrHtml,
traits::Object,
}; };
use anyhow::anyhow; use anyhow::anyhow;
use html2md::parse_html; use html2md::parse_html;
use lemmy_api_common::context::LemmyContext; use lemmy_api_common::context::LemmyContext;
use lemmy_utils::error::LemmyError; use lemmy_utils::error::LemmyError;
use serde::Deserialize;
use std::fmt::Debug; use std::fmt::Debug;
pub mod comment; pub mod comment;
@ -53,8 +55,8 @@ pub(crate) fn verify_is_remote_object<T>(
context: &Data<LemmyContext>, context: &Data<LemmyContext>,
) -> Result<(), LemmyError> ) -> Result<(), LemmyError>
where where
T: activitypub_federation::traits::Object<DataType = LemmyContext> + Debug + Send + 'static, T: Object<DataType = LemmyContext> + Debug + Send + 'static,
for<'de2> <T as activitypub_federation::traits::Object>::Kind: serde::Deserialize<'de2>, for<'de2> <T as Object>::Kind: Deserialize<'de2>,
{ {
if !id.is_local(context) { if !id.is_local(context) {
Err(anyhow!("cant accept local object from remote instance").into()) Err(anyhow!("cant accept local object from remote instance").into())