From: Felix Ableitner Date: Mon, 25 Oct 2021 14:15:03 +0000 (+0200) Subject: Rewrite community outbox to use new fetcher X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/readmes/README.zh.hant.md?a=commitdiff_plain;h=6792e376b435ac80ac68633978b5ec0e0346b96f;p=lemmy.git Rewrite community outbox to use new fetcher --- diff --git a/crates/apub/src/collections/community_outbox.rs b/crates/apub/src/collections/community_outbox.rs index 24465c95..4b5e7618 100644 --- a/crates/apub/src/collections/community_outbox.rs +++ b/crates/apub/src/collections/community_outbox.rs @@ -9,6 +9,7 @@ use activitystreams::{ base::AnyBase, chrono::NaiveDateTime, collection::kind::OrderedCollectionType, + object::Tombstone, primitives::OneOrMany, url::Url, }; @@ -43,7 +44,7 @@ pub(crate) struct ApubCommunityOutbox(Vec); #[async_trait::async_trait(?Send)] impl ApubObject for ApubCommunityOutbox { type DataType = CommunityContext; - type TombstoneType = (); + type TombstoneType = Tombstone; type ApubType = GroupOutbox; fn last_refreshed_at(&self) -> Option { diff --git a/crates/apub/src/collections/mod.rs b/crates/apub/src/collections/mod.rs index 948824e2..e2a274a0 100644 --- a/crates/apub/src/collections/mod.rs +++ b/crates/apub/src/collections/mod.rs @@ -1,5 +1,6 @@ use crate::objects::community::ApubCommunity; use lemmy_websocket::LemmyContext; + pub(crate) mod community_moderators; pub(crate) mod community_outbox; diff --git a/crates/apub/src/http/community.rs b/crates/apub/src/http/community.rs index 6a1c02d7..dcaf551f 100644 --- a/crates/apub/src/http/community.rs +++ b/crates/apub/src/http/community.rs @@ -6,14 +6,18 @@ use crate::{ report::Report, }, collections::{ - community_moderators::ApubCommunityModerators, community_outbox::ApubCommunityOutbox, + community_moderators::ApubCommunityModerators, + community_outbox::ApubCommunityOutbox, CommunityContext, }, context::lemmy_context, fetcher::object_id::ObjectId, generate_outbox_url, http::{ - create_apub_response, create_apub_tombstone_response, payload_to_string, receive_activity, + create_apub_response, + create_apub_tombstone_response, + payload_to_string, + receive_activity, }, objects::community::ApubCommunity, }; diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index 21ae614f..e71addba 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -1,12 +1,14 @@ use crate::{ check_is_apub_id_valid, collections::{ - community_moderators::ApubCommunityModerators, community_outbox::ApubCommunityOutbox, + community_moderators::ApubCommunityModerators, + community_outbox::ApubCommunityOutbox, CommunityContext, }, context::lemmy_context, fetcher::object_id::ObjectId, - generate_moderators_url, generate_outbox_url, + generate_moderators_url, + generate_outbox_url, objects::{get_summary_from_string_or_source, tombstone::Tombstone, ImageObject, Source}, CommunityType, };