forked from alemi/upub
fix: show in_reply_to and statuses count
This commit is contained in:
parent
a897edd310
commit
5f8d8be05a
2 changed files with 9 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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")))
|
||||
|
|
Loading…
Reference in a new issue