From cc45de7e6db64938ca970d0bdd064482abbbec78 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 8 Jun 2024 03:04:32 +0200 Subject: [PATCH] fix: don't remove object id when missing embed --- upub/core/src/selector.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/upub/core/src/selector.rs b/upub/core/src/selector.rs index e99e6335..ed3fdec5 100644 --- a/upub/core/src/selector.rs +++ b/upub/core/src/selector.rs @@ -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) } }