From 804a2fba2953a050d66c0082dce06672dd3a9cb3 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 25 Jun 2024 04:46:46 +0200 Subject: [PATCH] fix: im an idiot ................................. --- upub/core/src/traits/process.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/upub/core/src/traits/process.rs b/upub/core/src/traits/process.rs index c5ed6589..2e628222 100644 --- a/upub/core/src/traits/process.rs +++ b/upub/core/src/traits/process.rs @@ -439,16 +439,6 @@ pub async fn announce(ctx: &crate::Context, activity: impl apb::Activity, tx: &D // we only care about announces produced by "Person" actors, because there's intention // anything shared by groups, services or applications is automated: fetch it and be done if actor.actor_type == apb::ActorType::Person { - let share = crate::model::announce::ActiveModel { - internal: NotSet, - actor: Set(actor.internal), - object: Set(internal), - published: Set(activity.published().unwrap_or(chrono::Utc::now())), - }; - - crate::model::announce::Entity::insert(share) - .exec(tx).await?; - // if this user never "boosted" this object before, increase its counter if !crate::model::announce::Entity::find_by_uid_oid(actor.internal, internal) .any(tx) @@ -460,6 +450,16 @@ pub async fn announce(ctx: &crate::Context, activity: impl apb::Activity, tx: &D .exec(tx) .await?; } + + let share = crate::model::announce::ActiveModel { + internal: NotSet, + actor: Set(actor.internal), + object: Set(internal), + published: Set(activity.published().unwrap_or(chrono::Utc::now())), + }; + + crate::model::announce::Entity::insert(share) + .exec(tx).await?; } // TODO we should probably insert an activity, otherwise this won't appear on timelines!!