From d5c73e85e8aa3881067c6004c6a8bdf3f3ab9fb6 Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 26 Mar 2024 02:46:10 +0100 Subject: [PATCH] fix: fetch activity case for non embedded --- src/activitypub/activity.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activitypub/activity.rs b/src/activitypub/activity.rs index 5d4d1349..e71ab536 100644 --- a/src/activitypub/activity.rs +++ b/src/activitypub/activity.rs @@ -24,11 +24,14 @@ pub async fn view(State(ctx) : State, Path(id): Path) -> Result .one(ctx.db()) .await { - Ok(Some((activity, object))) => Ok(JsonLD( + Ok(Some((activity, Some(object)))) => Ok(JsonLD( ap_activity(activity) - .set_object(Node::maybe_object(object.map(super::object::ap_object))) + .set_object(Node::object(super::object::ap_object(object))) .ld_context() )), + Ok(Some((activity, None))) => Ok(JsonLD( + ap_activity(activity).ld_context() + )), Ok(None) => Err(StatusCode::NOT_FOUND), Err(e) => { tracing::error!("error querying for activity: {e}");