From c82f208517845344d5f360656f73318882eda176 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 2 Jun 2022 23:47:43 -0600 Subject: [PATCH] Update Inbox, store follow request activity --- app/Util/ActivityPub/Inbox.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index 331fd52c1..a874a39fe 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -473,17 +473,12 @@ class Inbox return; } if($target->is_private == true) { - FollowRequest::firstOrCreate([ + FollowRequest::updateOrCreate([ 'follower_id' => $actor->id, - 'following_id' => $target->id + 'following_id' => $target->id, + ],[ + 'activity' => collect($this->payload)->only(['id','actor','object'])->toArray() ]); - - Cache::forget('profile:follower_count:'.$target->id); - Cache::forget('profile:follower_count:'.$actor->id); - Cache::forget('profile:following_count:'.$target->id); - Cache::forget('profile:following_count:'.$actor->id); - FollowerService::add($actor->id, $target->id); - } else { $follower = new Follower; $follower->profile_id = $actor->id;