The original content of the post hadn't always been stored
authorMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 21:58:03 +0000 (21:58 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 21:58:03 +0000 (21:58 +0000)
src/Protocol/ActivityPub.php
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php

index f1cd652..fd2f84e 100644 (file)
@@ -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);
                }
        }
 
index 14b993e..2f4c784 100644 (file)
@@ -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'];
index 97eb3b6..67404af 100644 (file)
@@ -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') {