fix: ughhh must use activity id from payload

i should go to sleep ...
This commit is contained in:
əlemi 2024-08-15 05:41:50 +02:00
parent 43a4e70cf4
commit 52933da820
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -17,9 +17,9 @@ pub async fn process(ctx: Context, job: &model::job::Model) -> crate::JobResult<
let actor = upub::model::actor::Entity::ap_to_internal(&job.actor, &tx) let actor = upub::model::actor::Entity::ap_to_internal(&job.actor, &tx)
.await? .await?
.ok_or_else(|| DbErr::RecordNotFound(job.actor.clone()))?; .ok_or_else(|| DbErr::RecordNotFound(job.actor.clone()))?;
let activity = upub::model::activity::Entity::ap_to_internal(&job.activity, &tx) let activity = upub::model::activity::Entity::ap_to_internal(activity.object().id()?, &tx)
.await? .await?
.ok_or_else(|| DbErr::RecordNotFound(job.activity.clone()))?; .ok_or_else(|| DbErr::RecordNotFound(activity.object().id().unwrap_or_default().to_string()))?;
let notif_model = upub::model::notification::ActiveModel { let notif_model = upub::model::notification::ActiveModel {
internal: sea_orm::ActiveValue::NotSet, internal: sea_orm::ActiveValue::NotSet,
activity: sea_orm::ActiveValue::Unchanged(activity), activity: sea_orm::ActiveValue::Unchanged(activity),