use http::StatusCode;
use lemmy_api_common::context::LemmyContext;
use lemmy_db_schema::source::activity::Activity;
-use lemmy_utils::error::{LemmyError, LemmyResult};
+use lemmy_utils::error::{LemmyError, LemmyErrorType, LemmyResult};
use serde::{Deserialize, Serialize};
use std::ops::Deref;
use url::Url;
Ok(
HttpResponse::Ok()
.content_type(FEDERATION_CONTENT_TYPE)
- .content_type("application/json")
.body(json),
)
}
HttpResponse::Gone()
.content_type(FEDERATION_CONTENT_TYPE)
.status(StatusCode::GONE)
- .content_type("application/json")
.body(json),
)
}
fn err_object_not_local() -> LemmyError {
- LemmyError::from_message("Object not local, fetch it from original instance")
+ LemmyErrorType::ObjectNotLocal.into()
}
#[derive(Deserialize)]
info.id
))?
.into();
- let activity = Activity::read_from_apub_id(context.pool(), &activity_id).await?;
+ let activity = Activity::read_from_apub_id(&mut context.pool(), &activity_id).await?;
let sensitive = activity.sensitive;
if !activity.local {