From dca1d8f0c502d7dbe87bdf36344c626d440984aa Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Sat, 4 Aug 2018 06:05:41 +0100 Subject: [PATCH] Fix some issues from previous commit --- actions/apactoroutbox.php | 5 ++++- classes/Activitypub_create.php | 4 ++-- utils/postman.php | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/actions/apactoroutbox.php b/actions/apactoroutbox.php index 60986d8..b357cd2 100644 --- a/actions/apactoroutbox.php +++ b/actions/apactoroutbox.php @@ -123,7 +123,10 @@ class apActorOutboxAction extends ManagedAction // TODO: Handle other types if ($note->object_type == 'http://activitystrea.ms/schema/1.0/note') { - $notices[] = Activitypub_notice::notice_to_array($note); + $notices[] = Activitypub_create::create_to_array( + ActivityPubPlugin::actor_uri($note->getProfile()), + Activitypub_notice::notice_to_array($note) + ); } } diff --git a/classes/Activitypub_create.php b/classes/Activitypub_create.php index 8b1229d..f28e53d 100755 --- a/classes/Activitypub_create.php +++ b/classes/Activitypub_create.php @@ -48,14 +48,14 @@ class Activitypub_create extends Managed_DataObject * @param array $object * @return pretty array to be used in a response */ - public static function create_to_array($id, $actor, $object) + public static function create_to_array($actor, $object) { $res = [ '@context' => [ 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1' ], - 'id' => $id.'/create', + 'id' => $object.'/create', 'type' => 'Create', 'to' => $object['to'], 'cc' => $object['cc'], diff --git a/utils/postman.php b/utils/postman.php index ee320da..a647ea8 100755 --- a/utils/postman.php +++ b/utils/postman.php @@ -231,7 +231,6 @@ class Activitypub_postman public function create($notice) { $data = Activitypub_create::create_to_array( - $notice->getUrl(), $this->actor_uri, Activitypub_notice::notice_to_array($notice) );