fix: don't remove object id when missing embed
This commit is contained in:
parent
03bca17897
commit
cc45de7e6d
1 changed files with 7 additions and 5 deletions
|
@ -95,9 +95,10 @@ impl FromQueryResult for RichActivity {
|
|||
|
||||
impl RichActivity {
|
||||
pub fn ap(self) -> serde_json::Value {
|
||||
self.activity.ap()
|
||||
.set_object(apb::Node::maybe_object(
|
||||
self.object.map(|x| x.ap()
|
||||
let object = match self.object {
|
||||
None => apb::Node::maybe_link(self.activity.object.clone()),
|
||||
Some(o) => apb::Node::object(
|
||||
o.ap()
|
||||
.set_liked_by_me(if self.liked.is_some() { Some(true) } else { None })
|
||||
.set_attachment(match self.attachments {
|
||||
None => apb::Node::Empty,
|
||||
|
@ -105,8 +106,9 @@ impl RichActivity {
|
|||
vec.into_iter().map(|x| x.ap()).collect()
|
||||
),
|
||||
})
|
||||
)
|
||||
))
|
||||
),
|
||||
};
|
||||
self.activity.ap().set_object(object)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue