From 9fddc0f606460accf96dff586e729c49fab671f1 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Tue, 31 Jul 2018 22:47:20 +0100 Subject: [PATCH] Fix bugs --- actions/inbox/Follow.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/inbox/Follow.php b/actions/inbox/Follow.php index 12d6e8f..12ab597 100755 --- a/actions/inbox/Follow.php +++ b/actions/inbox/Follow.php @@ -38,6 +38,7 @@ if (!filter_var($data->object, FILTER_VALIDATE_URL)) { try { $object_profile = new Activitypub_explorer; $object_profile = $object_profile->lookup($data->object)[0]; + $object_profile = Activitypub_profile::from_profile($object_profile); } catch (Exception $e) { ActivityPubReturn::error("Invalid Object Actor URL.", 404); } @@ -47,7 +48,7 @@ try { Subscription::start($actor_profile, $object_profile); common_debug('ActivityPubPlugin: Accepted Follow 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))), Activitypub_profile::from_profile($object_profile)->getInbox()); + $postman->send(json_encode(Activitypub_accept::accept_to_array(Activitypub_follow::follow_to_array($data->actor, $data->object))), $object_profile->getInbox()); ActivityPubReturn::answer('', 202); } else { common_debug('ActivityPubPlugin: Received a repeated Follow request from '.$data->actor.' to '.$data->object);