From 43a4e70cf4e764d8ea1fbbcca61f0a018acb10dc Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 15 Aug 2024 05:39:40 +0200 Subject: [PATCH] fix: get actor id from job object --- upub/worker/src/outbound.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/upub/worker/src/outbound.rs b/upub/worker/src/outbound.rs index 376547e..3d4c6b4 100644 --- a/upub/worker/src/outbound.rs +++ b/upub/worker/src/outbound.rs @@ -14,12 +14,12 @@ pub async fn process(ctx: Context, job: &model::job::Model) -> crate::JobResult< // notifications as seen is a very internal thing to do and should not be in .process() // probably. still this feels a bit dirty to do, is there a better place to do it? if matches!(t, apb::ObjectType::Activity(apb::ActivityType::View)) { - let actor = upub::model::actor::Entity::ap_to_internal(activity.actor().id()?, &tx) + let actor = upub::model::actor::Entity::ap_to_internal(&job.actor, &tx) .await? - .ok_or_else(|| DbErr::RecordNotFound(activity.actor().id().unwrap_or_default().to_string()))?; - let activity = upub::model::activity::Entity::ap_to_internal(activity.object().id()?, &tx) + .ok_or_else(|| DbErr::RecordNotFound(job.actor.clone()))?; + let activity = upub::model::activity::Entity::ap_to_internal(&job.activity, &tx) .await? - .ok_or_else(|| DbErr::RecordNotFound(activity.actor().id().unwrap_or_default().to_string()))?; + .ok_or_else(|| DbErr::RecordNotFound(job.activity.clone()))?; let notif_model = upub::model::notification::ActiveModel { internal: sea_orm::ActiveValue::NotSet, activity: sea_orm::ActiveValue::Unchanged(activity),