From 625b8e0e02af0f271347ad355565a0565ec941d9 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 27 Mar 2024 04:28:09 +0100 Subject: [PATCH] fix: when missing embedded object still show url! --- src/activitypub/user/outbox.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/activitypub/user/outbox.rs b/src/activitypub/user/outbox.rs index bed94680..fc6334f1 100644 --- a/src/activitypub/user/outbox.rs +++ b/src/activitypub/user/outbox.rs @@ -66,10 +66,14 @@ pub async fn page( .set_ordered_items(Node::array( items .into_iter() - .map(|(a, o)| + .map(|(a, o)| { + let oid = a.object.clone(); super::super::activity::ap_activity(a) - .set_object(Node::maybe_object(o.map(super::super::object::ap_object))) - ) + .set_object(match o { + Some(o) => Node::object(super::super::object::ap_object(o)), + None => Node::maybe_link(oid), + }) + }) .collect() )) .ld_context()