diff --git a/src/routes/activitypub/object.rs b/src/routes/activitypub/object.rs index 716d461e..23e9cb42 100644 --- a/src/routes/activitypub/object.rs +++ b/src/routes/activitypub/object.rs @@ -16,6 +16,7 @@ pub fn ap_object(object: model::object::Model) -> serde_json::Value { .set_summary(object.summary.as_deref()) .set_content(object.content.as_deref()) .set_context(Node::maybe_link(object.context.clone())) + .set_in_reply_to(Node::maybe_link(object.in_reply_to.clone())) .set_published(Some(object.published)) .set_to(Node::links(object.to.0.clone())) .set_bto(Node::Empty) diff --git a/src/routes/activitypub/user/mod.rs b/src/routes/activitypub/user/mod.rs index ab99c853..429d1a86 100644 --- a/src/routes/activitypub/user/mod.rs +++ b/src/routes/activitypub/user/mod.rs @@ -61,8 +61,14 @@ pub async fn view( // local user Some((user, Some(cfg))) => { Ok(JsonLD(ap_user(user.clone()) // ew ugly clone TODO - .set_inbox(Node::link(url!(ctx, "/users/{id}/inbox"))) - .set_outbox(Node::link(url!(ctx, "/users/{id}/outbox"))) + .set_inbox(Node::link(url!(ctx, "/users/{id}/inbox"))) // TODO unread activities as count + .set_outbox(Node::object( + serde_json::Value::new_object() + .set_id(Some(&url!(ctx, "/users/{id}/outbox"))) + .set_collection_type(Some(apb::CollectionType::OrderedCollection)) + .set_first(Node::link(url!(ctx, "/users/{id}/outbox/page"))) + .set_total_items(Some(user.statuses_count as u64)) + )) .set_following(Node::object( serde_json::Value::new_object() .set_id(Some(&url!(ctx, "/users/{id}/following")))