feat: parse object comments count from replies
This commit is contained in:
parent
1ca97668a1
commit
f3dcbffeca
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
use apb::{BaseMut, ObjectMut};
|
use apb::{BaseMut, ObjectMut, Collection};
|
||||||
use sea_orm::entity::prelude::*;
|
use sea_orm::entity::prelude::*;
|
||||||
|
|
||||||
use crate::routes::activitypub::jsonld::LD;
|
use crate::routes::activitypub::jsonld::LD;
|
||||||
|
@ -39,7 +39,7 @@ impl Model {
|
||||||
context: object.context().id(),
|
context: object.context().id(),
|
||||||
in_reply_to: object.in_reply_to().id(),
|
in_reply_to: object.in_reply_to().id(),
|
||||||
published: object.published().ok_or(super::FieldError("published"))?,
|
published: object.published().ok_or(super::FieldError("published"))?,
|
||||||
comments: 0,
|
comments: object.replies().get().map(|x| x.total_items().unwrap_or(0)).unwrap_or(0) as i64,
|
||||||
likes: 0,
|
likes: 0,
|
||||||
shares: 0,
|
shares: 0,
|
||||||
to: object.to().into(),
|
to: object.to().into(),
|
||||||
|
|
Loading…
Reference in a new issue