From a17e83582c78daf5084b71948310946f5934b79d Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Wed, 1 Aug 2018 00:03:15 +0100 Subject: [PATCH] Fix typos on AP Accept class --- actions/inbox/Follow.php | 3 ++- classes/Activitypub_accept.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/actions/inbox/Follow.php b/actions/inbox/Follow.php index 51b79f0..781f158 100755 --- a/actions/inbox/Follow.php +++ b/actions/inbox/Follow.php @@ -54,7 +54,8 @@ if (!Subscription::exists($actor_profile, $object_profile)) { Subscription::start($actor_profile, $object_profile); common_debug('ActivityPubPlugin: Accepted Follow request from '.$data->actor.' to '.$data->object); - // Send Accept back + // Notify remote instance that we have accepted their request + common_debug('ActivityPubPlugin: Notifying remote instance that we have accepted their Follow request request from '.$data->actor.' to '.$data->object); $postman = new Activitypub_postman($actor_profile); $postman->send(json_encode(Activitypub_accept::accept_to_array(Activitypub_follow::follow_to_array($data->actor, $data->object))), $actor_aprofile->get_inbox()); ActivityPubReturn::answer('', 202); diff --git a/classes/Activitypub_accept.php b/classes/Activitypub_accept.php index 7725332..25cedf7 100755 --- a/classes/Activitypub_accept.php +++ b/classes/Activitypub_accept.php @@ -51,8 +51,8 @@ class Activitypub_accept extends Managed_DataObject { $res = [ '@context' => 'https://www.w3.org/ns/activitystreams', - 'id' => common_root_url().'follow_from_'.urlencode($object->actor).'_to_'.urlencode($object->object), - 'actor' => $object->object, + 'id' => common_root_url().'follow_from_'.urlencode($object['actor']).'_to_'.urlencode($object['object']), + 'actor' => $object['object'], 'type' => 'Accept', 'object' => $object ];