fix: don't remove object id when missing embed

This commit is contained in:
əlemi 2024-06-08 03:04:32 +02:00
parent 03bca17897
commit cc45de7e6d
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -95,9 +95,10 @@ impl FromQueryResult for RichActivity {
impl RichActivity { impl RichActivity {
pub fn ap(self) -> serde_json::Value { pub fn ap(self) -> serde_json::Value {
self.activity.ap() let object = match self.object {
.set_object(apb::Node::maybe_object( None => apb::Node::maybe_link(self.activity.object.clone()),
self.object.map(|x| x.ap() Some(o) => apb::Node::object(
o.ap()
.set_liked_by_me(if self.liked.is_some() { Some(true) } else { None }) .set_liked_by_me(if self.liked.is_some() { Some(true) } else { None })
.set_attachment(match self.attachments { .set_attachment(match self.attachments {
None => apb::Node::Empty, None => apb::Node::Empty,
@ -105,8 +106,9 @@ impl RichActivity {
vec.into_iter().map(|x| x.ap()).collect() vec.into_iter().map(|x| x.ap()).collect()
), ),
}) })
) ),
)) };
self.activity.ap().set_object(object)
} }
} }