From 2879e26955735277d7b82018fc8f3c2bbd982c3c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 12 Aug 2019 00:23:46 -0600 Subject: [PATCH] Update Inbox --- app/Util/ActivityPub/Inbox.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 2790cd8f3..36c2bf9ce 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -176,7 +176,7 @@ class Inbox 'following_id' => $target->id, 'local_profile' => empty($actor->domain) ]); - if($follower->wasRecentlyCreated == true) { + if($follower->wasRecentlyCreated == true && $target->domain == null) { // send notification Notification::firstOrCreate([ 'profile_id' => $target->id, @@ -188,14 +188,19 @@ class Inbox 'item_type' => 'App\Profile' ]); } - $payload = $this->payload; + // send Accept to remote profile $accept = [ '@context' => 'https://www.w3.org/ns/activitystreams', 'id' => $target->permalink().'#accepts/follows/' . $follower->id, 'type' => 'Accept', 'actor' => $target->permalink(), - 'object' => $payload + 'object' => [ + 'id' => $actor->permalink('#follows/' . $follower->id), + 'actor' => $actor->permalink(), + 'type' => 'Follow', + 'object' => $target->permalink() + ] ]; Helpers::sendSignedObject($target, $actor->inbox_url, $accept); }