use crate::{
activity_lists::AnnouncableActivities,
collections::CommunityContext,
- generate_outbox_url,
objects::post::ApubPost,
protocol::{
activities::{
use activitystreams_kinds::collection::OrderedCollectionType;
use chrono::NaiveDateTime;
use futures::future::join_all;
+use lemmy_api_common::utils::generate_outbox_url;
use lemmy_db_schema::{
source::{person::Person, post::Post},
traits::Crud,
+ utils::FETCH_LIMIT_MAX,
};
use lemmy_utils::error::LemmyError;
use url::Url;
type DataType = CommunityContext;
type ApubType = GroupOutbox;
type Error = LemmyError;
+ type DbType = ();
fn last_refreshed_at(&self) -> Option<NaiveDateTime> {
None
}
}
- async fn delete(self, _data: &Self::DataType) -> Result<(), LemmyError> {
- // do nothing (it gets deleted automatically with the community)
- Ok(())
- }
-
#[tracing::instrument(skip_all)]
async fn into_apub(self, data: &Self::DataType) -> Result<Self::ApubType, LemmyError> {
let mut ordered_items = vec![];
_request_counter: &mut i32,
) -> Result<Self, LemmyError> {
let mut outbox_activities = apub.ordered_items;
- if outbox_activities.len() > 20 {
- outbox_activities = outbox_activities[0..20].to_vec();
+ if outbox_activities.len() as i64 > FETCH_LIMIT_MAX {
+ outbox_activities = outbox_activities[0..(FETCH_LIMIT_MAX as usize)].to_vec();
}
// We intentionally ignore errors here. This is because the outbox might contain posts from old
// This return value is unused, so just set an empty vec
Ok(ApubCommunityOutbox(Vec::new()))
}
-
- type DbType = ();
}