Compare commits

...

2 commits

Author SHA1 Message Date
38efbeb76f
chore: imports 2024-05-12 00:56:27 +02:00
1219dbca34
fix: ownerships 2024-05-12 00:56:22 +02:00
2 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
use axum::{extract::{Path, Query, State}, http::StatusCode, Json};
use mastodon_async_entities::{account::{Account, AccountId}, status::Status};
use sea_orm::{ColumnTrait, EntityTrait, QueryFilter};
use axum::{extract::{Path, State}, http::StatusCode, Json};
use mastodon_async_entities::account::{Account, AccountId};
use sea_orm::EntityTrait;
use crate::{model, server::{auth::AuthIdentity, Context}};

View file

@ -60,10 +60,10 @@ impl apb::server::Inbox for Context {
.await?;
}
// lemmy sends us an image field in posts, treat it like an attachment i'd say
if let Some(img) = object.image().get() {
let attachment_model = model::attachment::ActiveModel::new(img, object_model.id.clone())?;
if let Some(img) = object_node.image().get() {
let attachment_model = model::attachment::ActiveModel::new(img, oid.clone())?;
model::attachment::Entity::insert(attachment_model)
.exec(ctx.db())
.exec(self.db())
.await?;
}
// TODO can we even receive anonymous objects?