From 68ce2192a1dc4fb61d96cd656c0afa8d215f77bd Mon Sep 17 00:00:00 2001 From: Namekuji Date: Thu, 18 May 2023 00:32:45 -0400 Subject: [PATCH] rename queue function --- packages/backend/crates/activitypub/src/federation/mod.rs | 2 +- packages/backend/crates/activitypub/src/lib.rs | 6 +++--- packages/backend/crates/activitypub/src/queue.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend/crates/activitypub/src/federation/mod.rs b/packages/backend/crates/activitypub/src/federation/mod.rs index bf77c83ea5..6f049d2344 100644 --- a/packages/backend/crates/activitypub/src/federation/mod.rs +++ b/packages/backend/crates/activitypub/src/federation/mod.rs @@ -6,4 +6,4 @@ pub(crate) mod reqwest_shim; pub(crate) mod traits; /// Mime type for Activitypub data, used for `Accept` and `Content-Type` HTTP headers -pub static FEDERATION_CONTENT_TYPE: &str = "application/activity+json"; +pub(crate) static FEDERATION_CONTENT_TYPE: &str = "application/activity+json"; diff --git a/packages/backend/crates/activitypub/src/lib.rs b/packages/backend/crates/activitypub/src/lib.rs index 96c9c5d420..7f2721d2a2 100644 --- a/packages/backend/crates/activitypub/src/lib.rs +++ b/packages/backend/crates/activitypub/src/lib.rs @@ -1,3 +1,3 @@ -mod error; -mod federation; -mod queue; +pub mod error; +pub(crate) mod federation; +pub mod queue; diff --git a/packages/backend/crates/activitypub/src/queue.rs b/packages/backend/crates/activitypub/src/queue.rs index 72e60721e5..6ec0bc088e 100644 --- a/packages/backend/crates/activitypub/src/queue.rs +++ b/packages/backend/crates/activitypub/src/queue.rs @@ -1,4 +1,4 @@ -//! Used to queue inbox and outbox tasks +//! Used to queue sending activity use crate::{ error::Error, @@ -39,7 +39,7 @@ pub struct SendActivityTask { pub trait QueueManager: DynClone + Send { /// Called in [crate::queue::send_activity], and would call /// [crate::queue::do_send] inside to send activity to remote servers. - async fn queue_send(&self, task: SendActivityTask) -> Result<(), Error>; + async fn queue_deliver(&self, task: SendActivityTask) -> Result<(), Error>; } clone_trait_object!(QueueManager); @@ -96,7 +96,7 @@ where } } else { debug!(task = ?message, "Queue sending activity"); - data.config.queue_manager.queue_send(message).await?; + data.config.queue_manager.queue_deliver(message).await?; } }