mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-01-11 13:45:25 +00:00
Extract Blog::outbox_collection()
This commit is contained in:
parent
ab6f39c192
commit
00862790a1
1 changed files with 5 additions and 1 deletions
|
@ -230,6 +230,10 @@ impl Blog {
|
|||
}
|
||||
|
||||
pub fn outbox(&self, conn: &Connection) -> Result<ActivityStream<OrderedCollection>> {
|
||||
self.outbox_collection(conn)
|
||||
.map(|coll| ActivityStream::new(coll))
|
||||
}
|
||||
pub fn outbox_collection(&self, conn: &Connection) -> Result<OrderedCollection> {
|
||||
let mut coll = OrderedCollection::default();
|
||||
coll.collection_props.items = serde_json::to_value(self.get_activities(conn))?;
|
||||
coll.collection_props
|
||||
|
@ -243,7 +247,7 @@ impl Blog {
|
|||
(self.get_activities(conn).len() as u64 + ITEMS_PER_PAGE as u64 - 1) as u64
|
||||
/ ITEMS_PER_PAGE as u64
|
||||
))))?;
|
||||
Ok(ActivityStream::new(coll))
|
||||
Ok(coll)
|
||||
}
|
||||
pub fn outbox_page(
|
||||
&self,
|
||||
|
|
Loading…
Reference in a new issue