From 77c056e93bf3da1e9a5272e7a08a942ea61d1340 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 24 Feb 2019 20:17:01 -0700 Subject: [PATCH] Update ActivityPub Inbox --- app/Util/ActivityPub/Inbox.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index adbb727f..244eb2aa 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -185,19 +185,18 @@ class Inbox 'following_id' => $target->id, 'local_profile' => empty($actor->domain) ]); - if($follower->wasRecentlyCreated == false) { - return; + if($follower->wasRecentlyCreated == true) { + // send notification + Notification::firstOrCreate([ + 'profile_id' => $target->id, + 'actor_id' => $actor->id, + 'action' => 'follow', + 'message' => $follower->toText(), + 'rendered' => $follower->toHtml(), + 'item_id' => $target->id, + 'item_type' => 'App\Profile' + ]); } - // send notification - Notification::firstOrCreate([ - 'profile_id' => $target->id, - 'actor_id' => $actor->id, - 'action' => 'follow', - 'message' => $follower->toText(), - 'rendered' => $follower->toHtml(), - 'item_id' => $target->id, - 'item_type' => 'App\Profile' - ]); // send Accept to remote profile $accept = [