Rewrite community outbox to use new fetcher

This commit is contained in:
Felix Ableitner 2021-10-25 16:15:03 +02:00
parent bb085189e0
commit 6792e376b4
4 changed files with 13 additions and 5 deletions

View File

@ -9,6 +9,7 @@ use activitystreams::{
base::AnyBase, base::AnyBase,
chrono::NaiveDateTime, chrono::NaiveDateTime,
collection::kind::OrderedCollectionType, collection::kind::OrderedCollectionType,
object::Tombstone,
primitives::OneOrMany, primitives::OneOrMany,
url::Url, url::Url,
}; };
@ -43,7 +44,7 @@ pub(crate) struct ApubCommunityOutbox(Vec<ApubPost>);
#[async_trait::async_trait(?Send)] #[async_trait::async_trait(?Send)]
impl ApubObject for ApubCommunityOutbox { impl ApubObject for ApubCommunityOutbox {
type DataType = CommunityContext; type DataType = CommunityContext;
type TombstoneType = (); type TombstoneType = Tombstone;
type ApubType = GroupOutbox; type ApubType = GroupOutbox;
fn last_refreshed_at(&self) -> Option<NaiveDateTime> { fn last_refreshed_at(&self) -> Option<NaiveDateTime> {

View File

@ -1,5 +1,6 @@
use crate::objects::community::ApubCommunity; use crate::objects::community::ApubCommunity;
use lemmy_websocket::LemmyContext; use lemmy_websocket::LemmyContext;
pub(crate) mod community_moderators; pub(crate) mod community_moderators;
pub(crate) mod community_outbox; pub(crate) mod community_outbox;

View File

@ -6,14 +6,18 @@ use crate::{
report::Report, report::Report,
}, },
collections::{ collections::{
community_moderators::ApubCommunityModerators, community_outbox::ApubCommunityOutbox, community_moderators::ApubCommunityModerators,
community_outbox::ApubCommunityOutbox,
CommunityContext, CommunityContext,
}, },
context::lemmy_context, context::lemmy_context,
fetcher::object_id::ObjectId, fetcher::object_id::ObjectId,
generate_outbox_url, generate_outbox_url,
http::{ 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, objects::community::ApubCommunity,
}; };

View File

@ -1,12 +1,14 @@
use crate::{ use crate::{
check_is_apub_id_valid, check_is_apub_id_valid,
collections::{ collections::{
community_moderators::ApubCommunityModerators, community_outbox::ApubCommunityOutbox, community_moderators::ApubCommunityModerators,
community_outbox::ApubCommunityOutbox,
CommunityContext, CommunityContext,
}, },
context::lemmy_context, context::lemmy_context,
fetcher::object_id::ObjectId, 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}, objects::{get_summary_from_string_or_source, tombstone::Tombstone, ImageObject, Source},
CommunityType, CommunityType,
}; };