From 8410c5e2837b8c18406743995b820f18ff886475 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 3 Mar 2020 22:43:19 +0000 Subject: [PATCH] The direction field needs to be removed --- src/Model/Conversation.php | 1 + src/Protocol/ActivityPub/Processor.php | 3 ++- src/Protocol/ActivityPub/Receiver.php | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Model/Conversation.php b/src/Model/Conversation.php index 80103b2dc..1dcb6b0c2 100644 --- a/src/Model/Conversation.php +++ b/src/Model/Conversation.php @@ -135,6 +135,7 @@ class Conversation unset($arr['conversation-href']); unset($arr['protocol']); unset($arr['source']); + unset($arr['direction']); return $arr; } diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 14b993e6e..2fd2f2f77 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -687,7 +687,8 @@ 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..075bc942e 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -784,7 +784,12 @@ 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') {