From e38640da76bb75ff9f8624c225ebcdd36a43f87d Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 3 Mar 2020 21:58:03 +0000 Subject: [PATCH] The original content of the post hadn't always been stored --- src/Protocol/ActivityPub.php | 2 +- src/Protocol/ActivityPub/Processor.php | 2 +- src/Protocol/ActivityPub/Receiver.php | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index f1cd652f4..fd2f84e51 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -209,7 +209,7 @@ class ActivityPub foreach ($items as $activity) { $ldactivity = JsonLD::compact($activity); - ActivityPub\Receiver::processActivity($ldactivity, '', $uid, true); + ActivityPub\Receiver::processActivity($ldactivity, json_encode($activity), $uid, true); } } diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 14b993e6e..2f4c78453 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -687,7 +687,7 @@ class Processor $ldactivity['thread-completion'] = true; - ActivityPub\Receiver::processActivity($ldactivity); + ActivityPub\Receiver::processActivity($ldactivity, json_encode($activity)); Logger::notice('Activity had been fetched and processed.', ['url' => $url, 'object' => $activity['id']]); return $activity['id']; diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 97eb3b62c..67404af5e 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -784,7 +784,11 @@ class Receiver } if (in_array($type, self::CONTENT_TYPES)) { - return self::processObject($object); + $object_data = self::processObject($object); + if (!empty($data)) { + $object_data['raw'] = json_encode($data); + } + return $object_data; } if ($type == 'as:Announce') {