diff --git a/src/server/context.rs b/src/server/context.rs index f3df64d3..2010d394 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -236,8 +236,14 @@ impl Context { .set_id(Some(&format!("{id}?offset={offset}"))) .set_collection_type(Some(apb::CollectionType::OrderedCollectionPage)) .set_part_of(apb::Node::link(id.replace("/page", ""))) - .set_next(apb::Node::link(format!("{id}?offset={}", offset+limit))) .set_ordered_items(apb::Node::array(items)) + .set_next( + if items.len() < limit as usize { + apb::Node::Empty + } else { + apb::Node::link(format!("{id}?offset={}", offset+limit)) + } + ) } pub async fn dispatch(&self, uid: &str, activity_targets: Vec, aid: &str, oid: Option<&str>) -> crate::Result<()> {