From ee12ef37adb4743574e4d7a8f1ce79ead57d63a4 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 22 Jun 2024 04:34:22 +0200 Subject: [PATCH] chore: better comments, unreachable!() --- upub/core/src/traits/process.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upub/core/src/traits/process.rs b/upub/core/src/traits/process.rs index 17bcadb..034548e 100644 --- a/upub/core/src/traits/process.rs +++ b/upub/core/src/traits/process.rs @@ -389,13 +389,13 @@ pub async fn announce(ctx: &crate::Context, activity: impl apb::Activity, tx: &D } } } { + crate::context::Internal::Activity(_) => unreachable!(), crate::context::Internal::Actor(_) => Err(ProcessorError::Unprocessable(activity.id()?.to_string())), - crate::context::Internal::Activity(_) => Err(ProcessorError::AlreadyProcessed), // ??? crate::context::Internal::Object(internal) => { let actor = ctx.fetch_user(activity.actor().id()?, tx).await?; - // we only care about "organic" announces, as in those produced by people - // anything shared by groups, services or applications is just mirroring: fetch it and be done + // 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,