From abf4e8b3702f8e2f563774ca08ea624d9e427bd6 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 24 Apr 2024 05:04:30 +0200 Subject: [PATCH] fix: always embed specific activities --- src/server/dispatcher.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/dispatcher.rs b/src/server/dispatcher.rs index e7d22d92..972e0e7f 100644 --- a/src/server/dispatcher.rs +++ b/src/server/dispatcher.rs @@ -78,9 +78,15 @@ async fn worker(db: DatabaseConnection, domain: String, poll_interval: u64, mut { Some((activity, None)) => activity.ap(), Some((activity, Some(object))) => { - // embed local object when dispatching - // TODO this .contains() is jank, could trick us into embedding remote activities - if object.id.contains(&domain) { + let always_embed = matches!( + activity.activity_type, + apb::ActivityType::Create + | apb::ActivityType::Undo + | apb::ActivityType::Update + | apb::ActivityType::Accept(_) + | apb::ActivityType::Reject(_) + ); + if always_embed { activity.ap().set_object(Node::object(object.ap())) } else { activity.ap()